summaryrefslogtreecommitdiffstats
path: root/Objects/funcobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-17 21:15:39 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-17 21:15:39 (GMT)
commitbbbd4fdba2c9589588410a4d1727c031234fc2a6 (patch)
tree2ad24f57d78dbe5438519ba30e1969c6eb3bf382 /Objects/funcobject.c
parent1a1f61b48f9295d07b2b07d13f49c03d37898d50 (diff)
downloadcpython-bbbd4fdba2c9589588410a4d1727c031234fc2a6.zip
cpython-bbbd4fdba2c9589588410a4d1727c031234fc2a6.tar.gz
cpython-bbbd4fdba2c9589588410a4d1727c031234fc2a6.tar.bz2
Make test_new pass.
Diffstat (limited to 'Objects/funcobject.c')
-rw-r--r--Objects/funcobject.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/funcobject.c b/Objects/funcobject.c
index adbb6d5..0069fc1 100644
--- a/Objects/funcobject.c
+++ b/Objects/funcobject.c
@@ -482,6 +482,11 @@ func_new(PyTypeObject* type, PyObject* args, PyObject* kw)
&PyDict_Type, &globals,
&name, &defaults, &closure))
return NULL;
+ if (PyUnicode_Check(name)) {
+ name = _PyUnicode_AsDefaultEncodedString(name, NULL);
+ if (name == NULL)
+ return NULL;
+ }
if (name != Py_None && !PyString_Check(name)) {
PyErr_SetString(PyExc_TypeError,
"arg 3 (name) must be None or string");