-
Notifications
You must be signed in to change notification settings - Fork 694
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
Add Python 3.11 support #2453
Add Python 3.11 support #2453
Conversation
So far, I only checked that uwsgi builds successfully on Python 3.11 :-) |
Fedora issue about uwsgi build issue with Python 3.11: https://bugzilla.redhat.com/show_bug.cgi?id=2099185 |
* Use PyFrame_GetCode(). * Add PyFrame_GetCode() for Python 3.8 and older. * Add UWSGI_PY311 macro: defined on Python 3.11 and newer. * struct uwsgi_python: "current_recursion_depth" becomes "current_recursion_remaining" and current_frame type becomes _PyCFrame** on Python 3.11. Related Python 3.11 changes: * https://docs.python.org/dev/whatsnew/3.11.html#id6 * The PyFrameObject structure became opaque. * PyThreadState.frame (PyFrameObject) became PyThreadState.cframe (_PyCFrame) in Python 3.11. * PyThreadState: recursion_depth was replaced with recursion_remaining + recursion_limit.
By the way, it would be nice to adapt
|
@@ -13,6 +13,14 @@ int PyFrame_GetLineNumber(PyFrameObject *frame) { | |||
} | |||
#endif | |||
|
|||
#if PY_VERSION_HEX < 0x030900B1 | |||
PyCodeObject* PyFrame_GetCode(PyFrameObject *frame) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using https://github.com/python/pythoncapi-compat/ here would be interesting here, but I tried to mimick the coding style of the existing uwsgi code.
I can add PyFrame_GetLineNumber() to pythoncapi-compat if you want. Maybe using pythoncapi_compat.h can be done later.
If you want, you can wait until the downstream patch is merged into Fedora: https://src.fedoraproject.org/rpms/uwsgi/pull-request/11 Fedora is being updated to Python 3.11. |
It got merged: https://src.fedoraproject.org/rpms/uwsgi/c/703b4ef92df1f0058bc07543fde9754de2fecc95?branch=rawhide |
Thanks a lot for the patch and for the heads up! |
"current_recursion_remaining" and current_frame type becomes
_PyCFrame** on Python 3.11.
Related Python 3.11 changes:
(_PyCFrame) in Python 3.11.
recursion_remaining + recursion_limit.