Skip to content

Commit b06c382

Browse files
committed
Removed shadowed variable and make _name_from_stem a staticmethod.
1 parent c68e382 commit b06c382

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

importlib_metadata/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -958,8 +958,9 @@ def _normalized_name(self):
958958
stem = os.path.basename(str(self._path))
959959
return self._name_from_stem(stem) or super()._normalized_name
960960

961-
def _name_from_stem(self, stem):
962-
name, ext = os.path.splitext(stem)
961+
@staticmethod
962+
def _name_from_stem(stem):
963+
_, ext = os.path.splitext(stem)
963964
if ext not in ('.dist-info', '.egg-info'):
964965
return
965966
name, sep, rest = stem.partition('-')

0 commit comments

Comments
 (0)