Instead, getters are provided which participate in reference counting; since this code runs as part of the SIGPROF handler, it cannot modify Python objects (including their refcounts) and the getters can't be used. Instead, we expose the internal _PyInterpreterFrame and use that directly.
feat: support Python 3.11 by using
_PyInternalFrame
directlyFixes https://github.com/GoogleCloudPlatform/cloud-profiler-python/issues/127
The
PyFrameObject
structure members have been removed from the public C API in 3.11: https://docs.python.org/3/whatsnew/3.11.html#pyframeobject-3-11-hiding.Instead, getters are provided which participate in reference counting; since this code runs as part of the SIGPROF handler, it cannot modify Python objects (including their refcounts) and the getters can't be used. Instead, we expose the internal
_PyInterpreterFrame
and use that directly.