diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-04-24 08:27:22 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-04-24 08:27:22 -0700 |
commit | 56ba6075ac4d887fca54107cba9dcdc541b44c6c (patch) | |
tree | 537f748cf7ec1a4b76b23a29908af3a16efd7eec | |
parent | cf679ae387519f658f17b2da2d05ff84834cb1f5 (diff) | |
parent | 86130cbbab36fc6069ab0f637d374673ea417814 (diff) | |
download | kafka-python-56ba6075ac4d887fca54107cba9dcdc541b44c6c.tar.gz |
Merge pull request #649 from jayalane/master
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..ea2621e 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'): + self._wake_r.close() + if hasattr(self, '_wake_w'): + self._wake_w.close() def _bootstrap(self, hosts): # Exponential backoff if bootstrap fails |