mirror of
https://github.com/python/cpython.git
synced 2025-09-18 22:50:26 +00:00
Issue #1680159: unicode coercion during an 'in' operation was masking
any errors that might occur during coercion of the left operand and turning them into a TypeError with a message text that was confusing in the given context. This patch lets any errors through, as was already done during coercion of the right hand side.
This commit is contained in:
parent
96228739c5
commit
0a0a1a842c
3 changed files with 6 additions and 3 deletions
|
@ -6502,8 +6502,6 @@ int PyUnicode_Contains(PyObject *container,
|
|||
/* Coerce the two arguments */
|
||||
sub = PyUnicode_FromObject(element);
|
||||
if (!sub) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"'in <string>' requires string as left operand");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue