From 8c372770c56f823e920f3852596636e343c2f5ac Mon Sep 17 00:00:00 2001 From: William Barnhart Date: Thu, 2 Nov 2023 23:37:08 -0400 Subject: [PATCH] Update conn.py to catch OSError in case of failed import Closes #2399. --- kafka/conn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/conn.py b/kafka/conn.py index cac354875..1efb8a0a1 100644 --- a/kafka/conn.py +++ b/kafka/conn.py @@ -78,7 +78,7 @@ class SSLWantWriteError(Exception): try: import gssapi from gssapi.raw.misc import GSSError -except ImportError: +except (ImportError, OSError): #no gssapi available, will disable gssapi mechanism gssapi = None GSSError = None