]> granicus.if.org Git - python/commitdiff
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 19 Mar 2017 19:06:29 +0000 (21:06 +0200)
committerGitHub <noreply@github.com>
Sun, 19 Mar 2017 19:06:29 +0000 (21:06 +0200)
(cherry picked from commit 6b5a9ec4788770c652bac3bf5d5a0a3b710b82ae)

Objects/bytearrayobject.c
Objects/bytesobject.c

index a8d698025087361f68d0b76b4820c0f279814cf8..d456678d462f2fb334c0b7a4149419d6568cb4d0 100644 (file)
@@ -254,7 +254,7 @@ PyByteArray_Concat(PyObject *a, PyObject *b)
     if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
         PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
             PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
-                         Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
+                         Py_TYPE(b)->tp_name, Py_TYPE(a)->tp_name);
             goto done;
     }
 
index 30c1a7e24532da26f148d7141a5ee1c1202c7d6a..c95a46d184664951c2fd73013dec5f43fed34d32 100644 (file)
@@ -1438,7 +1438,7 @@ bytes_concat(PyObject *a, PyObject *b)
     if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
         PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
         PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
-                     Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
+                     Py_TYPE(b)->tp_name, Py_TYPE(a)->tp_name);
         goto done;
     }