[Python-3000-checkins] r55933 - python/branches/py3k-struni/Objects/unicodeobject.c

walter.doerwald python-3000-checkins at python.org
Tue Jun 12 18:51:34 CEST 2007


Author: walter.doerwald
Date: Tue Jun 12 18:51:31 2007
New Revision: 55933

Modified:
   python/branches/py3k-struni/Objects/unicodeobject.c
Log:
Mention name of left operand, if "foo in unicode_string"
fails.


Modified: python/branches/py3k-struni/Objects/unicodeobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/unicodeobject.c	(original)
+++ python/branches/py3k-struni/Objects/unicodeobject.c	Tue Jun 12 18:51:31 2007
@@ -6001,8 +6001,9 @@
     /* Coerce the two arguments */
     sub = PyUnicode_FromObject(element);
     if (!sub) {
-	PyErr_SetString(PyExc_TypeError,
-	    "'in <string>' requires string as left operand");
+	PyErr_Format(PyExc_TypeError,
+	    "'in <string>' requires string as left operand, not %s",
+	    element->ob_type->tp_name);
         return -1;
     }
 


More information about the Python-3000-checkins mailing list