summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 284910d..b0b85ba 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -312,15 +312,12 @@ builtin_format(PyObject *self, PyObject *args)
/* 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;
}