diff Objects/typeobject.c @ 44626:60126aa3b816

Simplifed argument parsing in object.__format__, added test case.
author Eric Smith <eric@trueblade.com>
date Fri, 11 Jan 2008 00:17:22 +0000
parents 8bf6a9a3a632
children 5a71dcc71eff
line wrap: on
line diff
--- a/Objects/typeobject.c	Thu Jan 10 16:02:19 2008 +0000
+++ b/Objects/typeobject.c	Fri Jan 11 00:17:22 2008 +0000
@@ -2950,12 +2950,8 @@
         PyObject *result = NULL;
         PyObject *format_meth = NULL;
 
-        if (!PyArg_ParseTuple(args, "O:__format__", &format_spec))
+        if (!PyArg_ParseTuple(args, "U:__format__", &format_spec))
                 return NULL;
-        if (!PyUnicode_Check(format_spec)) {
-                PyErr_SetString(PyExc_TypeError, "Unicode object required");
-                return NULL;
-        }
 
         self_as_str = PyObject_Str(self);
         if (self_as_str != NULL) {