mirror of
https://github.com/python/cpython.git
synced 2024-11-23 18:04:37 +08:00
bpo-29116: Fix error messages for concatenating bytes and bytearray with unsupported type. (#709)
This commit is contained in:
parent
004e03fb0c
commit
6b5a9ec478
@ -254,7 +254,7 @@ PyByteArray_Concat(PyObject *a, PyObject *b)
|
|||||||
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
|
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
|
||||||
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
|
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
|
||||||
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
|
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;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1438,7 +1438,7 @@ bytes_concat(PyObject *a, PyObject *b)
|
|||||||
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
|
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
|
||||||
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
|
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
|
||||||
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
|
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;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user