EntryPoint is no longer a namedtuple. · python/importlib_metadata@29ec9c3 · GitHub
Skip to content

Commit 29ec9c3

Browse files
committed
EntryPoint is no longer a namedtuple.
1 parent 08d7def commit 29ec9c3

3 files changed

Lines changed: 35 additions & 43 deletions

File tree

importlib_metadata/__init__.py

Lines changed: 29 additions & 18 deletions

importlib_metadata/_compat.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import platform
33

44

5-
__all__ = ['install', 'NullFinder', 'PyPy_repr', 'Protocol']
5+
__all__ = ['install', 'NullFinder', 'Protocol']
66

77

88
try:
@@ -66,27 +66,6 @@ def find_spec(*args, **kwargs):
6666
find_module = find_spec
6767

6868

69-
class PyPy_repr:
70-
"""
71-
Override repr for EntryPoint objects on PyPy to avoid __iter__ access.
72-
Ref #97, #102.
73-
"""
74-
75-
affected = hasattr(sys, 'pypy_version_info')
76-
77-
def __compat_repr__(self): # pragma: nocover
78-
def make_param(name):
79-
value = getattr(self, name)
80-
return f'{name}={value!r}'
81-
82-
params = ', '.join(map(make_param, self._fields))
83-
return f'EntryPoint({params})'
84-
85-
if affected: # pragma: nocover
86-
__repr__ = __compat_repr__
87-
del affected
88-
89-
9069
def pypy_partial(val):
9170
"""
9271
Adjust for variable stacklevel on partial under PyPy.

tests/test_main.py

Lines changed: 5 additions & 3 deletions

0 commit comments

Comments
 (0)