mirror of
https://github.com/python/cpython.git
synced 2025-08-28 12:45:07 +00:00
Issue #28511: Use the "U" format instead of "O!" in PyArg_Parse*.
This commit is contained in:
parent
8c9331057d
commit
f8d7d41507
5 changed files with 20 additions and 37 deletions
|
@ -8621,7 +8621,7 @@ unicode_translate_call_errorhandler(const char *errors,
|
|||
Py_ssize_t startpos, Py_ssize_t endpos,
|
||||
Py_ssize_t *newpos)
|
||||
{
|
||||
static const char *argparse = "O!n;translating error handler must return (str, int) tuple";
|
||||
static const char *argparse = "Un;translating error handler must return (str, int) tuple";
|
||||
|
||||
Py_ssize_t i_newpos;
|
||||
PyObject *restuple;
|
||||
|
@ -8643,11 +8643,11 @@ unicode_translate_call_errorhandler(const char *errors,
|
|||
if (restuple == NULL)
|
||||
return NULL;
|
||||
if (!PyTuple_Check(restuple)) {
|
||||
PyErr_SetString(PyExc_TypeError, &argparse[4]);
|
||||
PyErr_SetString(PyExc_TypeError, &argparse[3]);
|
||||
Py_DECREF(restuple);
|
||||
return NULL;
|
||||
}
|
||||
if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type,
|
||||
if (!PyArg_ParseTuple(restuple, argparse,
|
||||
&resunicode, &i_newpos)) {
|
||||
Py_DECREF(restuple);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue