| 2278 | } |
| 2279 | |
| 2280 | static inline int |
| 2281 | PySys_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 |
nothing calls this directly
no test coverage detected