Skip to content

Commit

Permalink
Better compatibility with older importlib_metadata (pypa#4339)
Browse files Browse the repository at this point in the history
Don't call `setuptools.extern.importlib_metadata.EntryPoints.names` for better backwards compatibility.
  • Loading branch information
abravalheri committed May 2, 2024
2 parents 963dbd2 + 9cf334d commit dcfc833
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion setuptools/dist.py
Expand Up @@ -535,7 +535,8 @@ def warn_dash_deprecation(self, opt, section):

def _setuptools_commands(self):
try:
return metadata.distribution('setuptools').entry_points.names
entry_points = metadata.distribution('setuptools').entry_points
return {ep.name for ep in entry_points} # Avoid newer API for compatibility
except metadata.PackageNotFoundError:
# during bootstrapping, distribution doesn't exist
return []
Expand Down

0 comments on commit dcfc833

Please sign in to comment.