Skip to content

Commit

Permalink
Merge fix for bpo-46246
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Feb 11, 2022
2 parents 7a98b78 + 9ce8d6c commit d752bac
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v4.11.0
=======

* bpo-46246: Added ``__slots__`` to ``EntryPoints``.

v4.10.2
=======

Expand Down
2 changes: 2 additions & 0 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ class DeprecatedList(list):
1
"""

__slots__ = ()

_warn = functools.partial(
warnings.warn,
"EntryPoints list interface is deprecated. Cast to list if needed.",
Expand Down
5 changes: 5 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,11 @@ def test_entry_points_groups_get(self):
entry_points().get('entries', 'default') == entry_points()['entries']
entry_points().get('missing', ()) == ()

def test_entry_points_allows_no_attributes(self):
ep = entry_points().select(group='entries', name='main')
with self.assertRaises(AttributeError):
ep.foo = 4

def test_metadata_for_this_package(self):
md = metadata('egginfo-pkg')
assert md['author'] == 'Steven Ma'
Expand Down

0 comments on commit d752bac

Please sign in to comment.