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:
Alexandre Vassalotti 2008-05-09 19:50:27 +00:00
parent b2289ec60c
commit 14a767d4f4
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}