Skip to content

Commit dcfc833

Browse files
authored
Better compatibility with older importlib_metadata (pypa#4339)
Don't call `setuptools.extern.importlib_metadata.EntryPoints.names` for better backwards compatibility.
2 parents 963dbd2 + 9cf334d commit dcfc833

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setuptools/dist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ def warn_dash_deprecation(self, opt, section):
535535

536536
def _setuptools_commands(self):
537537
try:
538-
return metadata.distribution('setuptools').entry_points.names
538+
entry_points = metadata.distribution('setuptools').entry_points
539+
return {ep.name for ep in entry_points} # Avoid newer API for compatibility
539540
except metadata.PackageNotFoundError:
540541
# during bootstrapping, distribution doesn't exist
541542
return []

0 commit comments

Comments
 (0)