bpo-42089: Sync with current cpython branch of importlib_metadata (GH-22775)
~~The only differences are in the test files.~~
Automerge-Triggered-By: @jaraco
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 @@
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')):