summaryrefslogtreecommitdiff
path: root/kafka/client_async.py
diff options
context:
space:
mode:
Diffstat (limited to 'kafka/client_async.py')
-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..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