Skip to content

Commit 7aa997f

Browse files
authored
Bugfix: Types need identity comparison
`isinstance()` won't work here, as the types require identity comparison.
1 parent c6d8a53 commit 7aa997f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kafka/admin/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _send_request_to_controller(self, request):
334334
# DeleteTopicsResponse returns topic_error_codes rather than topic_errors
335335
for topic, error_code in getattr(response, "topic_errors", response.topic_error_codes):
336336
error_type = Errors.for_code(error_code)
337-
if tries and isinstance(error_type, NotControllerError):
337+
if tries and error_type is NotControllerError:
338338
# No need to inspect the rest of the errors for
339339
# non-retriable errors because NotControllerError should
340340
# either be thrown for all errors or no errors.

0 commit comments

Comments
 (0)