Skip to content

Commit 9cf334d

Browse files
committed
Avoid newer importlib-metadata APIs for backwards compatibility
1 parent 963dbd2 commit 9cf334d

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)