Ensure signals don't break on windows

This commit is contained in:
Matthias 2023-08-20 16:09:12 +02:00
parent f92b8c50dd
commit 4c5f992670

View File

@ -2357,7 +2357,11 @@ class Exchange:
pair=pair, since=since, until=until, from_id=from_id))
for sig in [signal.SIGINT, signal.SIGTERM]:
self.loop.add_signal_handler(sig, task.cancel)
try:
self.loop.add_signal_handler(sig, task.cancel)
except NotImplementedError:
# Not all platforms implement signals (e.g. windows)
pass
return self.loop.run_until_complete(task)
@retrier