PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
#endif
-#ifdef Py_BUILD_CORE
-PyAPI_FUNC(int) _PySys_AddXOptionWithError(const wchar_t *s);
-PyAPI_FUNC(int) _PySys_AddWarnOptionWithError(PyObject *option);
-#endif
-
#ifdef __cplusplus
}
#endif
PyList_SetSlice(warnoptions, 0, PyList_GET_SIZE(warnoptions), NULL);
}
-int
+static int
_PySys_AddWarnOptionWithError(PyObject *option)
{
PyObject *warnoptions = get_warnoptions();
void
PySys_AddWarnOptionUnicode(PyObject *option)
{
- (void)_PySys_AddWarnOptionWithError(option);
+ if (_PySys_AddWarnOptionWithError(option) < 0) {
+ /* No return value, therefore clear error state if possible */
+ if (_PyThreadState_UncheckedGet()) {
+ PyErr_Clear();
+ }
+ }
}
void
return xoptions;
}
-int
+static int
_PySys_AddXOptionWithError(const wchar_t *s)
{
PyObject *name = NULL, *value = NULL;