Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
patch _py_abc.py to fix pip
Signed-off-by: Ashwin Naren <[email protected]>
  • Loading branch information
arihant2math committed Apr 22, 2025
commit 092556a90626eb229a02a3f1dfa1b1e9c3b25285
6 changes: 4 additions & 2 deletions Lib/_py_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ class ABCMeta(type):
_abc_invalidation_counter = 0

def __new__(mcls, name, bases, namespace, /, **kwargs):
# TODO: RUSTPYTHON remove this line (prevents duplicate bases)
bases = tuple(dict.fromkeys(bases))
cls = super().__new__(mcls, name, bases, namespace, **kwargs)
# Compute set of abstract method names
abstracts = {name
Expand Down Expand Up @@ -98,8 +100,8 @@ def __instancecheck__(cls, instance):
subtype = type(instance)
if subtype is subclass:
if (cls._abc_negative_cache_version ==
ABCMeta._abc_invalidation_counter and
subclass in cls._abc_negative_cache):
ABCMeta._abc_invalidation_counter and
subclass in cls._abc_negative_cache):
return False
# Fall back to the subclass check.
return cls.__subclasscheck__(subclass)
Expand Down
Loading