forked from M-Labs/artiq
parent
44910efd0a
commit
223b984385
@ -168,6 +168,7 @@ class LogForwarder(logging.Handler, TaskObject):
|
||||
self._queue.put_nowait(record.source + ":" + self.format(record))
|
||||
|
||||
async def _do(self):
|
||||
reader = writer = None
|
||||
while True:
|
||||
try:
|
||||
reader, writer = await asyncio.open_connection(self.host,
|
||||
@ -182,4 +183,5 @@ class LogForwarder(logging.Handler, TaskObject):
|
||||
except:
|
||||
await asyncio.sleep(self.reconnect_timer)
|
||||
finally:
|
||||
writer.close()
|
||||
if writer is not None:
|
||||
writer.close()
|
||||
|
@ -243,7 +243,8 @@ class AsyncioClient:
|
||||
|
||||
No further method calls should be done after this method is called.
|
||||
"""
|
||||
self.__writer.close()
|
||||
if self.__writer is not None:
|
||||
self.__writer.close()
|
||||
self.__reader = None
|
||||
self.__writer = None
|
||||
self.__target_names = None
|
||||
|
Loading…
Reference in New Issue
Block a user