Skip to content

Commit

Permalink
Fix crash formatting error message
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoldbaum committed Jan 17, 2025
1 parent fb7f3d3 commit 695fb1d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setuptools/command/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,16 @@ def _validate_py_limited_api(self) -> None:
raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'")

if sysconfig.get_config_var("Py_GIL_DISABLED"):
# sys.abiflags is only defined on POSIX
abiflags = getattr(sys, "abiflags", "")
if abiflags:
abinote = "(sys.abiflags={}). "
else:
abinote = ". "
raise ValueError(
f"`py_limited_api={self.py_limited_api!r}` not supported. "
"`Py_LIMITED_API` is currently incompatible with "
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}). "
f"`Py_GIL_DISABLED`{abinote}"
"See https://github.com/python/cpython/issues/111506."
)

Expand Down

0 comments on commit 695fb1d

Please sign in to comment.