mirror of
https://github.com/python/cpython.git
synced 2025-10-16 19:57:59 +00:00
Added test to ensure __format__ methods return unicode objects.
This commit is contained in:
parent
a4b8d1de7c
commit
56e4a840bc
1 changed files with 1 additions and 4 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue