Skip to content

Commit

Permalink
Only add signal handler when client is created in main thread (Fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Feb 15, 2020
1 parent 5260f5c commit e1ed079
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engineio/client.py
Expand Up @@ -78,7 +78,8 @@ def __init__(self,
request_timeout=5,
ssl_verify=True):
global original_signal_handler
if original_signal_handler is None:
if original_signal_handler is None and \
threading.current_thread() == threading.main_thread():
original_signal_handler = signal.signal(signal.SIGINT,
signal_handler)
self.handlers = {}
Expand Down

0 comments on commit e1ed079

Please sign in to comment.