We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d84ca37 commit 4875bc5Copy full SHA for 4875bc5
1 file changed
importlib_resources/readers.py
@@ -1,10 +1,13 @@
1
+from __future__ import annotations
2
+
3
import collections
4
import contextlib
5
import itertools
6
import pathlib
7
import operator
8
import re
9
import warnings
10
+from collections.abc import Iterator
11
12
from . import abc
13
@@ -150,12 +153,12 @@ def _resolve(cls, path_str) -> abc.Traversable:
150
153
return dir
151
154
152
155
@classmethod
- def _candidate_paths(cls, path_str):
156
+ def _candidate_paths(cls, path_str: str) -> Iterator[abc.Traversable]:
157
yield pathlib.Path(path_str)
158
yield from cls._resolve_zip_path(path_str)
159
160
@staticmethod
- def _resolve_zip_path(path_str):
161
+ def _resolve_zip_path(path_str: str):
162
for match in reversed(list(re.finditer(r'[\\/]', path_str))):
163
with contextlib.suppress(
164
FileNotFoundError,
0 commit comments