Kaydet (Commit) 3d258b1e authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka Kaydeden (comit) GitHub

bpo-29116: Fix error messages for concatenating bytes and bytearray with…

bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. (#709) (#723)

(cherry picked from commit 6b5a9ec4)
üst da88596a
......@@ -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;
}
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment