-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Replace _Py_IsFinalizing with Py_IsFinalizing for Python 3.13 compatibility and added version hex #2360
base: main
Are you sure you want to change the base?
Conversation
Hi @Ko496-glitch! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
@Ko496-glitch I noticed you working in this area and wanted to draw your attention to this PR #2361 I would be interested in how you are building and encountered the python 3.13 issue and any review comments on the PR. That PR also handles the issue Issue #2358 |
@gmarzot for this issue i just went through the python directory in the codebase and checked for the most relevant file, good amount of info was already presented as this issue was also handled back in june in pr #42034. The change also seems good to the issuer. let me know if you want any other info on this PR. |
@gmarzot Hi just checking in to see if everything is good for this PR? |
I think something like this below is clearer and more direct: private:
static bool isPyFinalizing() noexcept {
#if PY_VERSION_HEX <= 0x03070000 // unsupported anyway - can remove
return false;
#elif PY_VERSION_HEX >= 0x030D0000 // Python 3.13+
return Py_IsFinalizing();
#else
return _Py_IsFinalizing();
#endif
} I think the PR I have here includes this solution and addresses a number of other issues getting the python bindings working so I would recommend that PR to the maintainers |
@Orvid has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
_Py_IsFinalizing
with the public APIPy_IsFinalizing
, introduced in Python 3.13.PY_VERSION_HEX
to ensure compatibility with older Python versions.Changes:
AsyncioExecutor.h
:_Py_IsFinalizing
withPy_IsFinalizing
._Py_IsFinalizing
for Python versions before 3.13.Reference: