mirror of https://github.com/python/cpython
Made the TypeError message in bytes_iconcat() less confusing.
Before this change, the following example would output: >>> b = bytearray(b"hello") >>> b += "world" Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can't concat bytes to bytearray
This commit is contained in:
parent
b2289ec60c
commit
14a767d4f4
|
@ -263,8 +263,8 @@ bytes_iconcat(PyBytesObject *self, PyObject *other)
|
|||
Py_buffer vo;
|
||||
|
||||
if (_getbuffer(other, &vo) < 0) {
|
||||
PyErr_Format(PyExc_TypeError, "can't concat bytes to %.100s",
|
||||
Py_TYPE(self)->tp_name);
|
||||
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
|
||||
Py_TYPE(other)->tp_name, Py_TYPE(self)->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue