Author: eric.smith
Date: Mon Aug 27 17:31:40 2007
New Revision: 57559

Modified:
   python/branches/py3k/Python/bltinmodule.c
Log:
Added test to ensure __format__ methods return unicode objects.

Modified: python/branches/py3k/Python/bltinmodule.c
==============================================================================
--- python/branches/py3k/Python/bltinmodule.c   (original)
+++ python/branches/py3k/Python/bltinmodule.c   Mon Aug 27 17:31:40 2007
@@ -312,15 +312,12 @@
         /* And call it, binding it to the value */
         result = PyObject_CallFunctionObjArgs(meth, value, spec, NULL);
 
-#if 0
-        /* XXX this is segfaulting, not sure why.  find out later! */
-       if (!PyUnicode_Check(result)) {
+       if (result && !PyUnicode_Check(result)) {
                 PyErr_SetString(PyExc_TypeError,
                                 "__format__ method did not return string");
                 Py_DECREF(result);
                 return NULL;
         }
-#endif
 
         return result;
 }
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins

Reply via email to