Better object checking on asyncreq cleanup

This commit is contained in:
Mike Place 2015-08-19 11:15:35 -06:00
parent e57f767244
commit e213840f4b

View File

@ -714,7 +714,7 @@ class AsyncReqMessageClient(object):
# TODO: timeout all in-flight sessions, or error
def destroy(self):
if hasattr(self, 'stream'):
if hasattr(self, 'stream') and self.stream is not None:
# TODO: Optionally call stream.close() on newer pyzmq? It is broken on some.
self.stream.socket.close()
self.stream.io_loop.remove_handler(self.stream.socket)