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

It returned 1 (success) when warnings are turned into exceptions.
(cherry picked from commit 107c21c5d5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-07-16 22:46:43 -07:00 committed by GitHub
parent 964431eaeb
commit 31608abf55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View file

@ -1016,7 +1016,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