[Python-3000-checkins] r55417 - in python/branches/py3k-struni: Lib/test/test_new.py Objects/funcobject.c
guido.van.rossum
python-3000-checkins at python.org
Thu May 17 23:15:43 CEST 2007
Author: guido.van.rossum
Date: Thu May 17 23:15:39 2007
New Revision: 55417
Modified:
python/branches/py3k-struni/Lib/test/test_new.py
python/branches/py3k-struni/Objects/funcobject.c
Log:
Make test_new pass.
Modified: python/branches/py3k-struni/Lib/test/test_new.py
==============================================================================
--- python/branches/py3k-struni/Lib/test/test_new.py (original)
+++ python/branches/py3k-struni/Lib/test/test_new.py Thu May 17 23:15:39 2007
@@ -143,7 +143,7 @@
firstlineno, lnotab)
# new.code used to be a way to mutate a tuple...
- class S(str):
+ class S(str8):
pass
t = (S("ab"),)
d = new.code(argcount, kwonlyargcount, nlocals, stacksize,
Modified: python/branches/py3k-struni/Objects/funcobject.c
==============================================================================
--- python/branches/py3k-struni/Objects/funcobject.c (original)
+++ python/branches/py3k-struni/Objects/funcobject.c Thu May 17 23:15:39 2007
@@ -482,6 +482,11 @@
&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");
More information about the Python-3000-checkins
mailing list