Skip to content

Commit 3d258b1

Browse files
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. (#709) (#723)
(cherry picked from commit 6b5a9ec)
1 parent da88596 commit 3d258b1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Objects/bytearrayobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ PyByteArray_Concat(PyObject *a, PyObject *b)
254254
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
255255
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
256256
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
257-
Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
257+
Py_TYPE(b)->tp_name, Py_TYPE(a)->tp_name);
258258
goto done;
259259
}
260260

Objects/bytesobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1438,7 +1438,7 @@ bytes_concat(PyObject *a, PyObject *b)
14381438
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
14391439
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
14401440
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
1441-
Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
1441+
Py_TYPE(b)->tp_name, Py_TYPE(a)->tp_name);
14421442
goto done;
14431443
}
14441444

0 commit comments

Comments
 (0)