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

Function PySys_GetAttrString

asyncpg/protocol/record/pythoncapi_compat.h:2234–2249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2232
2233#if PY_VERSION_HEX < 0x030F0000
2234static inline PyObject*
2235PySys_GetAttrString(const char *name)
2236{
2237#if PY_VERSION_HEX >= 0x03000000
2238 PyObject *value = Py_XNewRef(PySys_GetObject(name));
2239#else
2240 PyObject *value = Py_XNewRef(PySys_GetObject((char*)name));
2241#endif
2242 if (value != NULL) {
2243 return value;
2244 }
2245 if (!PyErr_Occurred()) {
2246 PyErr_Format(PyExc_RuntimeError, "lost sys.%s", name);
2247 }
2248 return NULL;
2249}
2250
2251static inline PyObject*
2252PySys_GetAttr(PyObject *name)

Callers 1

PySys_GetAttrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected