Skip to content

Commit 01843df

Browse files
committed
Fix issue when metadata on the file system has no version. No more egg on face. Ref #377.
1 parent 4461855 commit 01843df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

importlib_metadata/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,10 +968,10 @@ def _name_from_stem(stem):
968968
>>> PathDistribution._name_from_stem('face.egg-info')
969969
'face'
970970
"""
971-
_, ext = os.path.splitext(stem)
971+
filename, ext = os.path.splitext(stem)
972972
if ext not in ('.dist-info', '.egg-info'):
973973
return
974-
name, sep, rest = stem.partition('-')
974+
name, sep, rest = filename.partition('-')
975975
return name
976976

977977

0 commit comments

Comments
 (0)