diff options
Diffstat (limited to 'Objects/bytes_methods.c')
-rw-r--r-- | Objects/bytes_methods.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index 4e8107b4911..1cf20c97d3f 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -371,7 +371,7 @@ _getbuffer(PyObject *obj, Py_buffer *view) if (buffer == NULL || buffer->bf_getbuffer == NULL) { PyErr_Format(PyExc_TypeError, - "Type %.100s doesn't support the buffer API", + "a bytes-like object is required, not '%.100s'", Py_TYPE(obj)->tp_name); return -1; } @@ -382,9 +382,9 @@ _getbuffer(PyObject *obj, Py_buffer *view) } PyObject * -_Py_bytes_maketrans(PyObject *args) +_Py_bytes_maketrans(PyObject *frm, PyObject *to) { - PyObject *frm, *to, *res = NULL; + PyObject *res = NULL; Py_buffer bfrm, bto; Py_ssize_t i; char *p; @@ -392,8 +392,6 @@ _Py_bytes_maketrans(PyObject *args) bfrm.len = -1; bto.len = -1; - if (!PyArg_ParseTuple(args, "OO:maketrans", &frm, &to)) - return NULL; if (_getbuffer(frm, &bfrm) < 0) return NULL; if (_getbuffer(to, &bto) < 0) |