diff options
Diffstat (limited to 'Objects/clinic/bytearrayobject.c.h')
-rw-r--r-- | Objects/clinic/bytearrayobject.c.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Objects/clinic/bytearrayobject.c.h b/Objects/clinic/bytearrayobject.c.h index f21353a..ec35eef 100644 --- a/Objects/clinic/bytearrayobject.c.h +++ b/Objects/clinic/bytearrayobject.c.h @@ -354,7 +354,7 @@ bytearray_append(PyByteArrayObject *self, PyObject *arg) PyObject *return_value = NULL; int item; - if (!PyArg_Parse(arg, "O&:append", _getbytevalue, &item)) { + if (!_getbytevalue(arg, &item)) { goto exit; } return_value = bytearray_append_impl(self, item); @@ -430,7 +430,7 @@ bytearray_remove(PyByteArrayObject *self, PyObject *arg) PyObject *return_value = NULL; int value; - if (!PyArg_Parse(arg, "O&:remove", _getbytevalue, &value)) { + if (!_getbytevalue(arg, &value)) { goto exit; } return_value = bytearray_remove_impl(self, value); @@ -640,9 +640,14 @@ bytearray_fromhex(PyTypeObject *type, PyObject *arg) PyObject *return_value = NULL; PyObject *string; - if (!PyArg_Parse(arg, "U:fromhex", &string)) { + if (!PyUnicode_Check(arg)) { + _PyArg_BadArgument("fromhex", "str", arg); goto exit; } + if (PyUnicode_READY(arg) == -1) { + goto exit; + } + string = arg; return_value = bytearray_fromhex_impl(type, string); exit: @@ -712,4 +717,4 @@ bytearray_sizeof(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored)) { return bytearray_sizeof_impl(self); } -/*[clinic end generated code: output=b88bb192dddca6e1 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=cd3e13a1905a473c input=a9049054013a1b77]*/ |