summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2016-04-24 08:27:22 -0700
committerDana Powers <dana.powers@gmail.com>2016-04-24 08:27:22 -0700
commit56ba6075ac4d887fca54107cba9dcdc541b44c6c (patch)
tree537f748cf7ec1a4b76b23a29908af3a16efd7eec
parentcf679ae387519f658f17b2da2d05ff84834cb1f5 (diff)
parent86130cbbab36fc6069ab0f637d374673ea417814 (diff)
downloadkafka-python-56ba6075ac4d887fca54107cba9dcdc541b44c6c.tar.gz
Merge pull request #649 from jayalane/master
to squelch the __del issue
-rw-r--r--kafka/client_async.py6
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