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

Function PySys_GetOptionalAttr

asyncpg/protocol/record/pythoncapi_compat.h:2280–2294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2278}
2279
2280static inline int
2281PySys_GetOptionalAttr(PyObject *name, PyObject **value)
2282{
2283#if PY_VERSION_HEX >= 0x03000000
2284 const char *name_str = PyUnicode_AsUTF8(name);
2285#else
2286 const char *name_str = PyString_AsString(name);
2287#endif
2288 if (name_str == NULL) {
2289 *value = NULL;
2290 return -1;
2291 }
2292
2293 return PySys_GetOptionalAttrString(name_str, value);
2294}
2295#endif // PY_VERSION_HEX < 0x030F00A1
2296
2297

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected