mirror of
https://github.com/python/cpython.git
synced 2025-08-24 02:35:59 +00:00
Fix Unicode encode_wstr_utf8() (#127420)
Raise RuntimeError instead of RuntimeWarning.
This commit is contained in:
parent
a8dd821d5b
commit
bf21e2160d
1 changed files with 1 additions and 1 deletions
|
@ -16158,7 +16158,7 @@ encode_wstr_utf8(wchar_t *wstr, char **str, const char *name)
|
|||
int res;
|
||||
res = _Py_EncodeUTF8Ex(wstr, str, NULL, NULL, 1, _Py_ERROR_STRICT);
|
||||
if (res == -2) {
|
||||
PyErr_Format(PyExc_RuntimeWarning, "cannot encode %s", name);
|
||||
PyErr_Format(PyExc_RuntimeError, "cannot encode %s", name);
|
||||
return -1;
|
||||
}
|
||||
if (res < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue