Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

Don't fail when signals are not implemented. #3

Merged
merged 1 commit into from
Jun 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion maga.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ def run(self, port=6881):
transport, _ = self.loop.run_until_complete(coro)

for signame in ('SIGINT', 'SIGTERM'):
self.loop.add_signal_handler(getattr(signal, signame), self.stop)
try:
self.loop.add_signal_handler(getattr(signal, signame), self.stop)
except NotImplementedError:
# SIGINT and SIGTERM are not implemented on windows
pass

for node in self.bootstrap_nodes:
# Bootstrap
Expand Down