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

Function PyInterpreterState_Get

asyncpg/protocol/record/pythoncapi_compat.h:328–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326// bpo-39947 added PyInterpreterState_Get() to Python 3.9.0a5
327#if PY_VERSION_HEX < 0x030900A5 || defined(PYPY_VERSION)
328static inline PyInterpreterState* PyInterpreterState_Get(void)
329{
330 PyThreadState *tstate;
331 PyInterpreterState *interp;
332
333 tstate = PyThreadState_GET();
334 if (tstate == _Py_NULL) {
335 Py_FatalError("GIL released (tstate is NULL)");
336 }
337 interp = tstate->interp;
338 if (interp == _Py_NULL) {
339 Py_FatalError("no current interpreter");
340 }
341 return interp;
342}
343#endif
344
345

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected