mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
bpo-37483: add _PyObject_CallOneArg() function (#14558)
This commit is contained in:
parent
9d40554e0d
commit
196a530e00
44 changed files with 128 additions and 146 deletions
|
@ -89,8 +89,7 @@ _canresize(PyByteArrayObject *self)
|
|||
PyObject *
|
||||
PyByteArray_FromObject(PyObject *input)
|
||||
{
|
||||
return PyObject_CallFunctionObjArgs((PyObject *)&PyByteArray_Type,
|
||||
input, NULL);
|
||||
return _PyObject_CallOneArg((PyObject *)&PyByteArray_Type, input);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -2018,8 +2017,7 @@ bytearray_fromhex_impl(PyTypeObject *type, PyObject *string)
|
|||
{
|
||||
PyObject *result = _PyBytes_FromHex(string, type == &PyByteArray_Type);
|
||||
if (type != &PyByteArray_Type && result != NULL) {
|
||||
Py_SETREF(result, PyObject_CallFunctionObjArgs((PyObject *)type,
|
||||
result, NULL));
|
||||
Py_SETREF(result, _PyObject_CallOneArg((PyObject *)type, result));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue