gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (GH-94902)

It returned 1 (success) when warnings are turned into exceptions.
This commit is contained in:
Serhiy Storchaka 2022-07-17 08:23:37 +03:00 committed by GitHub
parent 30f28ac296
commit 107c21c5d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View file

@ -1017,7 +1017,7 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
{
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
"getargs: The '%c' format is deprecated. Use 'U' instead.", c)) {
return NULL;
RETURN_ERR_OCCURRED;
}
_Py_COMP_DIAG_PUSH
_Py_COMP_DIAG_IGNORE_DEPR_DECLS