diff options
author | Chris Lane <chlane@paypal.com> | 2016-04-13 19:54:55 -0700 |
---|---|---|
committer | Chris Lane <chlane@paypal.com> | 2016-04-13 19:54:55 -0700 |
commit | 92436c0ec02a450b509a3d80defd0606ba43b609 (patch) | |
tree | 94b052297baf69eb7477528f745862727fdb0028 | |
parent | 0c94b83a2dff8113b5fd7c16df8a11ca03c4377b (diff) | |
download | kafka-python-92436c0ec02a450b509a3d80defd0606ba43b609.tar.gz |
to squelch the __del issue
-rw-r--r-- | kafka/client_async.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kafka/client_async.py b/kafka/client_async.py index 2eb86cf..b72e98a 100644 --- a/kafka/client_async.py +++ b/kafka/client_async.py @@ -133,8 +133,10 @@ class KafkaClient(object): self._selector.register(self._wake_r, selectors.EVENT_READ) def __del__(self): - self._wake_r.close() - self._wake_w.close() + if hasattr(self, '_wake_r'): + os.close(self._wake_r) + if hasattr(self, '_wake_w'): + os.close(self._wake_w) def _bootstrap(self, hosts): # Exponential backoff if bootstrap fails |