diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2021-05-21 17:00:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 17:00:40 (GMT) |
commit | 875b3d84b3072b2d3c352ad9f0ff52c441fbd12e (patch) | |
tree | 5fc461ab2855ee1f5f74992e43e7f681712b4be0 /Lib/importlib | |
parent | b51081c1a8cf01b92ba0692173e1b9274a57f455 (diff) | |
download | cpython-875b3d84b3072b2d3c352ad9f0ff52c441fbd12e.zip cpython-875b3d84b3072b2d3c352ad9f0ff52c441fbd12e.tar.gz cpython-875b3d84b3072b2d3c352ad9f0ff52c441fbd12e.tar.bz2 |
bpo-43643: Sync with python/importlib_resources@c17a610aad. (GH-26284)
* bpo-43643: Sync with python/importlib_resources@c17a610aad.
* Sync with python/importlib_resources@89fd5e961a.
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/_common.py | 3 | ||||
-rw-r--r-- | Lib/importlib/readers.py | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/importlib/_common.py b/Lib/importlib/_common.py index 0338304..ed50997 100644 --- a/Lib/importlib/_common.py +++ b/Lib/importlib/_common.py @@ -7,7 +7,7 @@ import types import importlib from typing import Union, Any, Optional -from .abc import ResourceReader +from .abc import ResourceReader, Traversable from ._adapters import wrap_spec @@ -15,6 +15,7 @@ Package = Union[types.ModuleType, str] def files(package): + # type: (Package) -> Traversable """ Get a Traversable resource from a package """ diff --git a/Lib/importlib/readers.py b/Lib/importlib/readers.py index 535c828..3e91c1c 100644 --- a/Lib/importlib/readers.py +++ b/Lib/importlib/readers.py @@ -96,6 +96,7 @@ class MultiplexedPath(abc.Traversable): def open(self, *args, **kwargs): raise FileNotFoundError('{} is not a file'.format(self)) + @property def name(self): return self._paths[0].name |