mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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
1 changed files with 2 additions and 2 deletions
|
@ -263,8 +263,8 @@ bytes_iconcat(PyBytesObject *self, PyObject *other)
|
||||||
Py_buffer vo;
|
Py_buffer vo;
|
||||||
|
|
||||||
if (_getbuffer(other, &vo) < 0) {
|
if (_getbuffer(other, &vo) < 0) {
|
||||||
PyErr_Format(PyExc_TypeError, "can't concat bytes to %.100s",
|
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
|
||||||
Py_TYPE(self)->tp_name);
|
Py_TYPE(other)->tp_name, Py_TYPE(self)->tp_name);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue