Skip to content

Commit 75ecd7e

Browse files
authored
importlib.resources is a package on 3.11+ (#9822)
1 parent 8a2bc88 commit 75ecd7e

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

stdlib/VERSIONS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ importlib: 2.7-
152152
importlib.metadata: 3.8-
153153
importlib.metadata._meta: 3.10-
154154
importlib.resources: 3.7-
155+
importlib.resources.abc: 3.11-
155156
inspect: 2.7-
156157
io: 2.7-
157158
ipaddress: 3.3-

stdlib/importlib/resources/abc.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sys
2+
3+
if sys.version_info >= (3, 11):
4+
# These are all actually defined in this file on 3.11+,
5+
# and re-exported from importlib.abc,
6+
# but it's much less code duplication for typeshed if we pretend that they're still defined
7+
# in importlib.abc on 3.11+, and re-exported from this file
8+
from importlib.abc import (
9+
ResourceReader as ResourceReader,
10+
Traversable as Traversable,
11+
TraversableResources as TraversableResources,
12+
)

0 commit comments

Comments
 (0)