Skip to content

Commit 2c5b2c3

Browse files
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. (#709) (#724)
(cherry picked from commit 6b5a9ec)
1 parent 88b32eb commit 2c5b2c3

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
@@ -1272,7 +1272,7 @@ bytes_concat(PyObject *a, PyObject *b)
12721272
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
12731273
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
12741274
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
1275-
Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
1275+
Py_TYPE(b)->tp_name, Py_TYPE(a)->tp_name);
12761276
goto done;
12771277
}
12781278

0 commit comments

Comments
 (0)