File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed
src/confluent_kafka/cimpl Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " confluent-kafka"
7- version = " 2.11.0+gr"
7+ version = " 2.11.0+gr.1 "
88description = " Confluent's Python client for Apache Kafka"
99classifiers = [
1010 " Development Status :: 5 - Production/Stable" ,
Original file line number Diff line number Diff line change 1- try :
2- from .sasl2_3 .cimpl import *
3- variant = "sasl2_3"
4- except ImportError :
1+ import importlib
2+
3+ variant = None
4+
5+ for module_name in ("sasl2_3" , "sasl2_2" , "nodeps" ):
56 try :
6- from .sasl2_2 .cimpl import *
7- variant = "sasl2_2"
8- except ImportError :
9- from .nodeps .cimpl import *
10- variant = "nodeps"
7+ module = importlib .import_module (f".{ module_name } .cimpl" , __package__ )
8+ variant = module_name
9+ for name in dir (module ):
10+ if not name .startswith ("__" ):
11+ globals ()[name ] = getattr (module , name )
12+ break
13+ except ModuleNotFoundError :
14+ pass
15+
16+ if variant is None :
17+ msg = "No valid native Python extension found"
18+ raise ImportError (msg )
You can’t perform that action at this time.
0 commit comments