[Fix] bug when __thread not created

This commit is contained in:
vn.py 2019-09-19 15:18:51 +08:00
parent 6f3a2b49c8
commit 5e8a648874

View File

@ -1,3 +1,4 @@
from zmq.backend.cython.constants import NOBLOCK
import signal import signal
import threading import threading
import traceback import traceback
@ -7,10 +8,11 @@ from typing import Any, Callable
import zmq import zmq
_ = lambda x: x
def _(x): return x
# Achieve Ctrl-c interrupt recv # Achieve Ctrl-c interrupt recv
from zmq.backend.cython.constants import NOBLOCK
signal.signal(signal.SIGINT, signal.SIG_DFL) signal.signal(signal.SIGINT, signal.SIG_DFL)
@ -100,7 +102,7 @@ class RpcServer:
def join(self): def join(self):
# Wait for RpcServer thread to exit # Wait for RpcServer thread to exit
if self.__thread.isAlive(): if self.__thread and self.__thread.is_alive():
self.__thread.join() self.__thread.join()
self.__thread = None self.__thread = None