mirror of
https://github.com/python/cpython.git
synced 2025-11-01 22:21:35 +00:00
parent
7c22ab5b38
commit
53ebb6232a
3 changed files with 44 additions and 12 deletions
|
|
@ -15121,7 +15121,16 @@ unicode_vectorcall(PyObject *type, PyObject *const *args,
|
|||
return PyObject_Str(object);
|
||||
}
|
||||
const char *encoding = arg_as_utf8(args[1], "encoding");
|
||||
const char *errors = (nargs == 3) ? arg_as_utf8(args[2], "errors") : NULL;
|
||||
if (encoding == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
const char *errors = NULL;
|
||||
if (nargs == 3) {
|
||||
errors = arg_as_utf8(args[2], "errors");
|
||||
if (errors == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return PyUnicode_FromEncodedObject(object, encoding, errors);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue