Skip to content

Commit e1ed079

Browse files
Only add signal handler when client is created in main thread (Fixes miguelgrinberg#163)
1 parent 5260f5c commit e1ed079

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

engineio/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def __init__(self,
7878
request_timeout=5,
7979
ssl_verify=True):
8080
global original_signal_handler
81-
if original_signal_handler is None:
81+
if original_signal_handler is None and \
82+
threading.current_thread() == threading.main_thread():
8283
original_signal_handler = signal.signal(signal.SIGINT,
8384
signal_handler)
8485
self.handlers = {}

0 commit comments

Comments
 (0)