Skip to content

Commit

Permalink
[Fix] bug when __thread not created
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Sep 19, 2019
1 parent 6f3a2b4 commit 5e8a648
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vnpy/rpc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from zmq.backend.cython.constants import NOBLOCK
import signal
import threading
import traceback
Expand All @@ -7,10 +8,11 @@

import zmq

_ = lambda x: x

def _(x): return x

# Achieve Ctrl-c interrupt recv
from zmq.backend.cython.constants import NOBLOCK


signal.signal(signal.SIGINT, signal.SIG_DFL)

Expand Down Expand Up @@ -100,7 +102,7 @@ def stop(self):

def join(self):
# Wait for RpcServer thread to exit
if self.__thread.isAlive():
if self.__thread and self.__thread.is_alive():
self.__thread.join()
self.__thread = None

Expand Down

0 comments on commit 5e8a648

Please sign in to comment.