mach: fix crash when sending notifications on Windows Server 2019 (#32352)

This commit is contained in:
Delan Azabani 2024-05-23 15:30:32 +08:00 committed by GitHub
parent 14286d913d
commit ff166ea1e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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):