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:
R. David Murray 2009-12-14 16:28:26 +00:00
parent 96228739c5
commit 0a0a1a842c
3 changed files with 6 additions and 3 deletions

View file

@ -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;
}