Skip to content

Commit 3a476c3

Browse files
committedApr 19, 2023
fix: Python 3.12 removed pkgutils
1 parent 45ed6ea commit 3a476c3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed
 

‎tests/test_venv.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ def sixth(x):
116116
__path__ = extend_path(__path__, __name__)
117117
""")
118118
make_file("bug888/app/testcov/main.py", """\
119-
import pkg_resources
120-
for entry_point in pkg_resources.iter_entry_points('plugins'):
119+
try: # pragma: no cover
120+
entry_points = __import__("pkg_resources").iter_entry_points('plugins')
121+
except ImportError: # pragma: no cover
122+
import importlib.metadata
123+
entry_points = importlib.metadata.entry_points(group="plugins")
124+
for entry_point in entry_points:
121125
entry_point.load()()
122126
""")
123127
make_file("bug888/plugin/setup.py", """\

0 commit comments

Comments
 (0)