Skip to content

Commit b421475

Browse files
committed
Fix tests
1 parent b16b50e commit b421475

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/importlib/resources/__init__.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ else:
6464
def read_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> str: ...
6565
def path(package: Package, resource: Resource) -> AbstractContextManager[Path, Literal[False]]: ...
6666
def is_resource(package: Package, name: str) -> bool: ...
67-
@deprecated("Deprecated since Python 3.11, use `files(anchor).iterdir()`")
68-
def contents(package: Package) -> Iterator[str]: ...
67+
if sys.version_info >= (3, 11):
68+
@deprecated("Deprecated since Python 3.11, use `files(anchor).iterdir()`")
69+
def contents(package: Package) -> Iterator[str]: ...
70+
else:
71+
def contents(package: Package) -> Iterator[str]: ...
6972

7073
if sys.version_info >= (3, 11):
7174
from importlib.resources._common import as_file as as_file

0 commit comments

Comments
 (0)