Fix initializing of handler exception

This commit is contained in:
taizan-hokuto
2019-11-11 22:56:54 +09:00
parent b17f3ce06e
commit df33771b10

View File

@@ -92,8 +92,9 @@ class ReplayChatAsync:
else:
self._set_exception_handler(exception_handler)
if interruptable:
signal.signal(signal.SIGINT, (lambda a, b:
(ReplayChatAsync.shutdown(None,signal.SIGINT,b))
signal.signal(signal.SIGINT,
(lambda a, b:asyncio.create_task(
ReplayChatAsync.shutdown(None,signal.SIGINT,b))
))
def _setup(self):
@@ -276,7 +277,7 @@ class ReplayChatAsync:
self._is_alive = False
if self._direct_mode == False:
#bufferにダミーオブジェクトを入れてis_alive()を判定させる
self._buffer.put({'chatdata':'','timeout':1})
self._buffer.put_nowait({'chatdata':'','timeout':1})
logger.info(f'終了しました:[{self.video_id}]')
@classmethod