summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorHugo van Kemenade <1324225+hugovk@users.noreply.github.com>2024-12-17 16:06:36 (GMT)
committerHugo van Kemenade <1324225+hugovk@users.noreply.github.com>2024-12-17 16:06:36 (GMT)
commitbe8ae086874cac42eea104c1ff21ef5868d50bdd (patch)
tree905b6c9326e3ebee2047a18e5eba981c81c35dcc /Python
parentd70e5c1fefb69c541205a7e97795f10fd61c2905 (diff)
parent7303f06846b69016a075bca7ad7c6055f29ad024 (diff)
downloadcpython-be8ae086874cac42eea104c1ff21ef5868d50bdd.zip
cpython-be8ae086874cac42eea104c1ff21ef5868d50bdd.tar.gz
cpython-be8ae086874cac42eea104c1ff21ef5868d50bdd.tar.bz2
Merge branch 'main' of https://github.com/python/cpython
Diffstat (limited to 'Python')
-rw-r--r--Python/errors.c9
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)