diff options
author | Barry Warsaw <barry@python.org> | 2020-10-19 21:14:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-19 21:14:21 (GMT) |
commit | 96ddc58281d2b6b2258b1a628bccf252090d5611 (patch) | |
tree | 7147b420c790abefc96072a9ec311ffe9cddc509 /Lib/importlib | |
parent | 95ad890a7b0341d8d2fde13f824bc24c65a8ece0 (diff) | |
download | cpython-96ddc58281d2b6b2258b1a628bccf252090d5611.zip cpython-96ddc58281d2b6b2258b1a628bccf252090d5611.tar.gz cpython-96ddc58281d2b6b2258b1a628bccf252090d5611.tar.bz2 |
bpo-42089: Sync with current cpython branch of importlib_metadata (GH-22775)
~~The only differences are in the test files.~~
Automerge-Triggered-By: @jaraco
Diffstat (limited to 'Lib/importlib')
-rw-r--r-- | Lib/importlib/metadata.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/importlib/metadata.py b/Lib/importlib/metadata.py index ffa0cba..302d61d 100644 --- a/Lib/importlib/metadata.py +++ b/Lib/importlib/metadata.py @@ -37,6 +37,15 @@ __all__ = [ class PackageNotFoundError(ModuleNotFoundError): """The package was not found.""" + def __str__(self): + tmpl = "No package metadata was found for {self.name}" + return tmpl.format(**locals()) + + @property + def name(self): + name, = self.args + return name + class EntryPoint( collections.namedtuple('EntryPointBase', 'name value group')): |