Skip to content

Commit f8c52bb

Browse files
wip
1 parent a132679 commit f8c52bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

astroid/brain/brain_collections.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
def _collections_transform():
2222
return parse(
23-
(" import _collections_abc as abc" if PY313_PLUS and not PY313_0 else "")
24-
+ """
23+
"""
2524
class defaultdict(dict):
2625
default_factory = None
2726
def __missing__(self, key): pass
@@ -40,6 +39,11 @@ def _collections_abc_313_0_transform() -> nodes.Module:
4039
)
4140

4241

42+
def _collections_abc_313_1_transform() -> nodes.Module:
43+
"""See https://github.com/python/cpython/pull/124735"""
44+
return AstroidBuilder(AstroidManager()).string_build("from collections import abc")
45+
46+
4347
def _deque_mock():
4448
base_deque_class = """
4549
class deque(object):
@@ -137,3 +141,7 @@ def register(manager: AstroidManager) -> None:
137141
register_module_extender(
138142
manager, "collections.abc", _collections_abc_313_0_transform
139143
)
144+
elif PY313_PLUS:
145+
register_module_extender(
146+
manager, "_collections_abc", _collections_abc_313_1_transform
147+
)

0 commit comments

Comments
 (0)