mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Fix bug:
[ 1327110 ] wrong TypeError traceback in generator expressions by removing the code that can stomp on the users' TypeError raised by the iterable argument to ''.join() -- PySequence_Fast (now?) gives a perfectly reasonable message itself. Also, a couple of tests.
This commit is contained in:
parent
aee2e2829d
commit
b2308bb9be
4 changed files with 20 additions and 8 deletions
|
@ -1620,10 +1620,6 @@ string_join(PyStringObject *self, PyObject *orig)
|
|||
|
||||
seq = PySequence_Fast(orig, "");
|
||||
if (seq == NULL) {
|
||||
if (PyErr_ExceptionMatches(PyExc_TypeError))
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"sequence expected, %.80s found",
|
||||
orig->ob_type->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -4148,10 +4148,6 @@ PyUnicode_Join(PyObject *separator, PyObject *seq)
|
|||
|
||||
fseq = PySequence_Fast(seq, "");
|
||||
if (fseq == NULL) {
|
||||
if (PyErr_ExceptionMatches(PyExc_TypeError))
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"sequence expected, %.80s found",
|
||||
seq->ob_type->tp_name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue