diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/errors.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/errors.c b/Python/errors.c index 7f3b4aa..2d362c1 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -301,6 +301,15 @@ PyErr_SetString(PyObject *exception, const char *string) _PyErr_SetString(tstate, exception, string); } +void +_PyErr_SetLocaleString(PyObject *exception, const char *string) +{ + PyObject *value = PyUnicode_DecodeLocale(string, "surrogateescape"); + if (value != NULL) { + PyErr_SetObject(exception, value); + Py_DECREF(value); + } +} PyObject* _Py_HOT_FUNCTION PyErr_Occurred(void) |