Commit f6e1f936 by David Hotham Committed by GitHub

handle importlib-metadata deprecation (#7774)

parent 860c8387
...@@ -257,9 +257,8 @@ class InstalledRepository(Repository): ...@@ -257,9 +257,8 @@ class InstalledRepository(Repository):
if path in skipped: if path in skipped:
continue continue
try: name = distribution.metadata.get("name") # type: ignore[attr-defined]
name = canonicalize_name(distribution.metadata["name"]) if name is None:
except TypeError:
logger.warning( logger.warning(
( (
"Project environment contains an invalid distribution" "Project environment contains an invalid distribution"
...@@ -271,6 +270,8 @@ class InstalledRepository(Repository): ...@@ -271,6 +270,8 @@ class InstalledRepository(Repository):
skipped.add(path) skipped.add(path)
continue continue
name = canonicalize_name(name)
if name in seen: if name in seen:
continue continue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment