diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-08-26 04:51:10 (GMT) |
commit | ed2b7397a0558414e1ec61c48bc889bb05e261ea (patch) | |
tree | 2516676def25ff2857db8fffebbe97fb23c1cb54 /Objects/moduleobject.c | |
parent | 6ea45d33412d4ecb2862645d57137b7ea1223281 (diff) | |
download | cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.zip cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.tar.gz cpython-ed2b7397a0558414e1ec61c48bc889bb05e261ea.tar.bz2 |
Use unicode and remove support for some uses of str8.
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r-- | Objects/moduleobject.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c index 19bb149..fbb9fba 100644 --- a/Objects/moduleobject.c +++ b/Objects/moduleobject.c @@ -66,17 +66,12 @@ PyModule_GetName(PyObject *m) d = ((PyModuleObject *)m)->md_dict; if (d == NULL || (nameobj = PyDict_GetItemString(d, "__name__")) == NULL || - !(PyString_Check(nameobj) || PyUnicode_Check(nameobj))) + !PyUnicode_Check(nameobj)) { PyErr_SetString(PyExc_SystemError, "nameless module"); return NULL; } - if (PyUnicode_Check(nameobj)) { - nameobj = _PyUnicode_AsDefaultEncodedString(nameobj, NULL); - if (nameobj == NULL) - return NULL; - } - return PyString_AsString(nameobj); + return PyUnicode_AsString(nameobj); } const char * |