Skip to content

Commit 575f6c7

Browse files
authored
Fix loading of private symbols within cimpl + bump version to 2.11.0+gr.1 (#7)
* Fix loading of private symbols within cimpl * Bump version to 2.11.0+gr.1
1 parent 2dbfd66 commit 575f6c7

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "confluent-kafka"
7-
version = "2.11.0+gr"
7+
version = "2.11.0+gr.1"
88
description = "Confluent's Python client for Apache Kafka"
99
classifiers = [
1010
"Development Status :: 5 - Production/Stable",
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
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)

0 commit comments

Comments
 (0)