Skip to content

Commit

Permalink
Fix uncaught TypeError accessing setuptools_dist.version
Browse files Browse the repository at this point in the history
  • Loading branch information
ctcjab authored and jab committed Nov 8, 2024
1 parent 4204359 commit 6d87336
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pip/_internal/network/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,12 @@ def user_agent() -> str:

setuptools_dist = get_default_environment().get_distribution("setuptools")
if setuptools_dist is not None:
data["setuptools_version"] = str(setuptools_dist.version)
try:
setuptools_version = setuptools_dist.version
except TypeError:
logging.debug("Caught TypeError accessing setuptools_dist.version")
else:
data["setuptools_version"] = str(setuptools_version)

if shutil.which("rustc") is not None:
# If for any reason `rustc --version` fails, silently ignore it
Expand Down

0 comments on commit 6d87336

Please sign in to comment.