More coding by random modification.
Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes.
This commit is contained in:
@@ -72,8 +72,11 @@ PyModule_GetName(PyObject *m)
|
||||
PyErr_SetString(PyExc_SystemError, "nameless module");
|
||||
return NULL;
|
||||
}
|
||||
if (PyUnicode_Check(nameobj))
|
||||
nameobj = _PyUnicode_AsDefaultEncodedString(nameobj, "replace");
|
||||
if (PyUnicode_Check(nameobj)) {
|
||||
nameobj = _PyUnicode_AsDefaultEncodedString(nameobj, NULL);
|
||||
if (nameobj == NULL)
|
||||
return NULL;
|
||||
}
|
||||
return PyString_AsString(nameobj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user