Skip to content

Commit 8f362c3

Browse files
committed
Fix crash formatting error message
1 parent fb7f3d3 commit 8f362c3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

setuptools/command/bdist_wheel.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,15 @@ def _validate_py_limited_api(self) -> None:
291291
raise ValueError(f"py-limited-api must match '{PY_LIMITED_API_PATTERN}'")
292292

293293
if sysconfig.get_config_var("Py_GIL_DISABLED"):
294+
# sys.abiflags is only defined on POSIX
295+
if getattr(sys, "abiflags", ""):
296+
abinote = f" ({sys.abiflags=!r}). "
297+
else:
298+
abinote = ". "
294299
raise ValueError(
295300
f"`py_limited_api={self.py_limited_api!r}` not supported. "
296301
"`Py_LIMITED_API` is currently incompatible with "
297-
f"`Py_GIL_DISABLED` ({sys.abiflags=!r}). "
302+
f"`Py_GIL_DISABLED`{abinote}"
298303
"See https://github.com/python/cpython/issues/111506."
299304
)
300305

0 commit comments

Comments
 (0)