Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Victor Stinner <[email protected]>
  • Loading branch information
encukou and vstinner authored Apr 10, 2026
commit 7c9d92006e8d24fda1f5a249bcc3918779d52e7a
5 changes: 3 additions & 2 deletions Include/pyabi.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@
# define Py_GIL_DISABLED
# endif
# if defined(_Py_IS_TESTCEXT)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may move #ifdef __GNUC__ here:

Suggested change
# if defined(_Py_IS_TESTCEXT)
# if defined(_Py_IS_TESTCEXT) && defined(__GNUC__)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This subtle style detail is intentional: I'm inviting #elifs for other compilers.

// When compiling for abi3t, contents of Python.h should not depend
// When compiling for abi3t, contents of Python.h should not depend
// on Py_GIL_DISABLED.
// We ask GCC to error if it sees the macro from this point on.
// Since users are free to the macro, and there's no way to undo the
// poisoning at the end of Python.h, we only do this in a test module.
// poisoning at the end of Python.h, we only do this in a test module
// (test_cext).
# ifdef __GNUC__
# undef Py_GIL_DISABLED
# pragma GCC poison Py_GIL_DISABLED
Expand Down
Loading