diff options
author | Delan Azabani <dazabani@igalia.com> | 2024-05-23 15:30:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-23 07:30:32 +0000 |
commit | ff166ea1e3086adb2b5019b31bf51c921e7f151b (patch) | |
tree | be833671a2b3c95ea28ce8bb6372b6456583239a /python/servo | |
parent | 14286d913d5a88647fad2255f06bec0763914e55 (diff) | |
download | servo-ff166ea1e3086adb2b5019b31bf51c921e7f151b.tar.gz servo-ff166ea1e3086adb2b5019b31bf51c921e7f151b.zip |
mach: fix crash when sending notifications on Windows Server 2019 (#32352)
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/build_commands.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index df8843d61a4..070873ad5b3 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -256,12 +256,15 @@ class MachCommands(CommandBase): print("[Warning] Could not generate notification: " f"Could not run '{notify_command}'.", file=sys.stderr) else: - notifier = LinuxNotifier if sys.platform.startswith("linux") else None - notification = notifypy.Notify(use_custom_notifier=notifier) - notification.title = title - notification.message = message - notification.icon = path.join(self.get_top_dir(), "resources", "servo_64.png") - notification.send(block=False) + try: + notifier = LinuxNotifier if sys.platform.startswith("linux") else None + notification = notifypy.Notify(use_custom_notifier=notifier) + notification.title = title + notification.message = message + notification.icon = path.join(self.get_top_dir(), "resources", "servo_64.png") + notification.send(block=False) + except notifypy.exceptions.UnsupportedPlatform as e: + print(f"[Warning] Could not generate notification: {e}", file=sys.stderr) def otool(s): |