Skip to content

Commit 92436c0

Browse files
to squelch the __del issue
1 parent 0c94b83 commit 92436c0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kafka/client_async.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ def __init__(self, **configs):
133133
self._selector.register(self._wake_r, selectors.EVENT_READ)
134134

135135
def __del__(self):
136-
self._wake_r.close()
137-
self._wake_w.close()
136+
if hasattr(self, '_wake_r'):
137+
os.close(self._wake_r)
138+
if hasattr(self, '_wake_w'):
139+
os.close(self._wake_w)
138140

139141
def _bootstrap(self, hosts):
140142
# Exponential backoff if bootstrap fails

0 commit comments

Comments
 (0)