MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / PyFrame_GetLasti

Function PyFrame_GetLasti

asyncpg/protocol/record/pythoncapi_compat.h:224–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222// bpo-40421 added PyFrame_GetLasti() to Python 3.11.0b1
223#if PY_VERSION_HEX < 0x030B00B1 && !defined(PYPY_VERSION)
224static inline int PyFrame_GetLasti(PyFrameObject *frame)
225{
226#if PY_VERSION_HEX >= 0x030A00A7
227 // bpo-27129: Since Python 3.10.0a7, f_lasti is an instruction offset,
228 // not a bytes offset anymore. Python uses 16-bit "wordcode" (2 bytes)
229 // instructions.
230 if (frame->f_lasti < 0) {
231 return -1;
232 }
233 return frame->f_lasti * 2;
234#else
235 return frame->f_lasti;
236#endif
237}
238#endif
239
240

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected