diff options
author | Florian Bruhin <me@the-compiler.org> | 2022-03-30 14:21:23 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2022-03-30 14:21:23 +0200 |
commit | 85158357f0e87ffe21cfa8dc1a6ed9a3724f2c7c (patch) | |
tree | 2efaf56878e37a52aaf45f920bd3808a864e77e0 | |
parent | 757532e568bbee57880ef70fa4be4e4bc4647c2d (diff) | |
download | qutebrowser-85158357f0e87ffe21cfa8dc1a6ed9a3724f2c7c.tar.gz qutebrowser-85158357f0e87ffe21cfa8dc1a6ed9a3724f2c7c.zip |
Update importlib.resources annotation comments
A zipfile.Path *is* a Traversable
-rw-r--r-- | qutebrowser/utils/resources.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/qutebrowser/utils/resources.py b/qutebrowser/utils/resources.py index d664498a7..b14b0faf4 100644 --- a/qutebrowser/utils/resources.py +++ b/qutebrowser/utils/resources.py @@ -39,9 +39,6 @@ import qutebrowser _cache = {} -# Unfortunately, we can't tell mypy about this also possibly being a -# zipfile.Path because we set "python_version = 3.6" in .mypy.ini, but the -# zipfile stubs (correctly) only declare zipfile.Path with Python 3.8... _ResourceType = Union[Traversable, pathlib.Path] @@ -89,7 +86,7 @@ def _glob( assert isinstance(glob_path, pathlib.Path) for full_path in glob_path.glob(f'*{ext}'): # . is contained in ext yield full_path.relative_to(resource_path).as_posix() - else: # zipfile.Path or importlib_resources.abc.Traversable + else: # zipfile.Path or other importlib_resources.abc.Traversable assert glob_path.is_dir(), glob_path for subpath in glob_path.iterdir(): if subpath.name.endswith(ext): |