Use unicode and remove support for some uses of str8.

This commit is contained in:
Neal Norwitz 2007-08-26 04:51:10 +00:00
parent 6ea45d3341
commit ed2b7397a0
5 changed files with 15 additions and 31 deletions

View file

@ -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 *