From 85158357f0e87ffe21cfa8dc1a6ed9a3724f2c7c Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 30 Mar 2022 14:21:23 +0200 Subject: Update importlib.resources annotation comments A zipfile.Path *is* a Traversable --- qutebrowser/utils/resources.py | 5 +---- 1 file changed, 1 insertion(+), 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): -- cgit v1.2.3-54-g00ecf