Skip to content

Commit 1c30e38

Browse files
committed
Fix importlib-resources in 3.5.0-3.5.3
1 parent a8a471c commit 1c30e38

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

importlib_resources/_py3.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
from pathlib import Path
1111
from types import ModuleType
1212
from typing import Iterable, Iterator, Optional, Set, Union # noqa: F401
13-
from typing import ContextManager
1413
from typing import cast
1514
from typing.io import BinaryIO, TextIO
1615

16+
if False: # TYPE_CHECKING
17+
from typing import ContextManager
1718

1819
Package = Union[ModuleType, str]
1920
if sys.version_info >= (3, 6):
@@ -140,7 +141,7 @@ def files(package: Package) -> trees.Traversable:
140141

141142
def path(
142143
package: Package, resource: Resource,
143-
) -> ContextManager[Path]:
144+
) -> 'ContextManager[Path]':
144145
"""A context manager providing a file path object to the resource.
145146
146147
If the resource does not already exist on its own on the file system,

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ commands =
4040
deps =
4141
mypy
4242
flake8
43+
flake8-typing-imports
4344

4445

4546
[testenv:docs]

0 commit comments

Comments
 (0)