Skip to content

Commit

Permalink
In localize_dist, cast the result to paper over an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Sep 11, 2024
1 parent 749c5ab commit 0783ade
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion importlib_metadata/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ def localize_dist(
if isinstance(dist, importlib_metadata.Distribution):
return dist
if isinstance(dist, importlib.metadata.PathDistribution):
return importlib_metadata.PathDistribution(dist._path)
return importlib_metadata.PathDistribution(
cast(importlib_metadata._meta.SimplePath, dist._path)
)
warnings.warn(f"Unrecognized distribution subclass {dist.__class__}")
return cast(importlib_metadata.Distribution, dist)

Expand Down

0 comments on commit 0783ade

Please sign in to comment.