-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-29116: Fix error messages for concatenating bytes and bytearray w… #709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-29116: Fix error messages for concatenating bytes and bytearray w… #709
Conversation
…ith unsupported type.
@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tiran, @loewis and @benjaminp to be potential reviewers. |
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be clearer to use "concatenate" instead of "concat" here and above. (Also other errors of similar kind use the full word.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do this in separate PR, because this is larger change that shouldn't be backported. The same error message is generated in yet one place (with correct order of arguments). Maybe will make the message being more similar to other concatenate messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…ith unsupported type. (python#709) (cherry picked from commit 6b5a9ec)
…ith unsupported type. (python#709) (cherry picked from commit 6b5a9ec)
…ith unsupported type.