@@ -4,7 +4,7 @@ from collections.abc import Iterator
44from contextlib import AbstractContextManager
55from pathlib import Path
66from types import ModuleType
7- from typing import Any , BinaryIO , TextIO
7+ from typing import Any , BinaryIO , Literal , TextIO
88from typing_extensions import TypeAlias
99
1010if sys .version_info >= (3 , 11 ):
@@ -51,14 +51,14 @@ else:
5151 def open_text (package : Package , resource : Resource , encoding : str = "utf-8" , errors : str = "strict" ) -> TextIO : ...
5252 def read_binary (package : Package , resource : Resource ) -> bytes : ...
5353 def read_text (package : Package , resource : Resource , encoding : str = "utf-8" , errors : str = "strict" ) -> str : ...
54- def path (package : Package , resource : Resource ) -> AbstractContextManager [Path ]: ...
54+ def path (package : Package , resource : Resource ) -> AbstractContextManager [Path , Literal [ False ] ]: ...
5555 def is_resource (package : Package , name : str ) -> bool : ...
5656 def contents (package : Package ) -> Iterator [str ]: ...
5757
5858if sys .version_info >= (3 , 11 ):
5959 from importlib .resources ._common import as_file as as_file
6060elif sys .version_info >= (3 , 9 ):
61- def as_file (path : Traversable ) -> AbstractContextManager [Path ]: ...
61+ def as_file (path : Traversable ) -> AbstractContextManager [Path , Literal [ False ] ]: ...
6262
6363if sys .version_info >= (3 , 11 ):
6464 from importlib .resources ._common import files as files
0 commit comments