Mercurial > cpython-lru_cache-weakref
diff Objects/moduleobject.c @ 42855:d5b52d56beba
Use unicode and remove support for some uses of str8.
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 26 Aug 2007 04:51:10 +0000 |
| parents | 3152df70517a |
| children | 19319e70fc3e |
line wrap: on
line diff
--- a/Objects/moduleobject.c Sun Aug 26 04:19:43 2007 +0000 +++ b/Objects/moduleobject.c Sun Aug 26 04:51:10 2007 +0000 @@ -66,17 +66,12 @@ 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 *
