File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 20
20
21
21
def _collections_transform ():
22
22
return parse (
23
- (" import _collections_abc as abc" if PY313_PLUS and not PY313_0 else "" )
24
- + """
23
+ """
25
24
class defaultdict(dict):
26
25
default_factory = None
27
26
def __missing__(self, key): pass
@@ -40,6 +39,11 @@ def _collections_abc_313_0_transform() -> nodes.Module:
40
39
)
41
40
42
41
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
+
43
47
def _deque_mock ():
44
48
base_deque_class = """
45
49
class deque(object):
@@ -137,3 +141,7 @@ def register(manager: AstroidManager) -> None:
137
141
register_module_extender (
138
142
manager , "collections.abc" , _collections_abc_313_0_transform
139
143
)
144
+ elif PY313_PLUS :
145
+ register_module_extender (
146
+ manager , "_collections_abc" , _collections_abc_313_1_transform
147
+ )
You can’t perform that action at this time.
0 commit comments