Kaydet (Commit) 56e4a840 authored tarafından Eric Smith's avatar Eric Smith

Added test to ensure __format__ methods return unicode objects.

üst a4b8d1de
...@@ -312,15 +312,12 @@ builtin_format(PyObject *self, PyObject *args) ...@@ -312,15 +312,12 @@ builtin_format(PyObject *self, PyObject *args)
/* And call it, binding it to the value */ /* And call it, binding it to the value */
result = PyObject_CallFunctionObjArgs(meth, value, spec, NULL); result = PyObject_CallFunctionObjArgs(meth, value, spec, NULL);
#if 0 if (result && !PyUnicode_Check(result)) {
/* XXX this is segfaulting, not sure why. find out later! */
if (!PyUnicode_Check(result)) {
PyErr_SetString(PyExc_TypeError, PyErr_SetString(PyExc_TypeError,
"__format__ method did not return string"); "__format__ method did not return string");
Py_DECREF(result); Py_DECREF(result);
return NULL; return NULL;
} }
#endif
return result; return result;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment