Skip to content

Commit

Permalink
Allow for no original signal handler (#517). (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrnz committed Jul 9, 2020
1 parent a4f9992 commit 8107216
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion socketio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ def signal_handler(sig, frame): # pragma: no cover
"""
for client in reconnecting_clients[:]:
client._reconnect_abort.set()
return original_signal_handler(sig, frame)
if callable(original_signal_handler):
return original_signal_handler(sig, frame)
else: # pragma: no cover
# Handle case where no original SIGINT handler was present.
return signal.default_int_handler(sig, frame)


original_signal_handler = None
Expand Down

0 comments on commit 8107216

Please sign in to comment.