Restore compatibility with Python 3.11 #31
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PyFrameObjects are now lazily allocated and no longer part of the PyThreadState. Therefore switch the _PyCFrame instead, but keep the PyFrameObject* for GC.
python/cpython@ae0a2b7
The recursion_depth is no longer stored directly in the PyThreadState and needs to be calculated from recursion_remaining and recursion_limit.
python/cpython@b931077
The exc_state was also simplified (no more exc_type and exc_traceback).
python/cpython@396b583
Finally the frame "data stack" needs to be saved and restored. How this was done in python-greenlet was used as a reference.
Restore compatibility with Python 3.11 python-greenlet/greenlet#280
Add new test test_clean_callstack to check that the call stack from the creation of the Fiber doesn't leak into it (i.e.
tstate->cframe->current_frame = NULL;
instacklet__callback
;tstate->frame = NULL;
in older Python versions).