More coding by random modification.
Encoding now return bytes instead of str8.
eval(), exec(), compile() now accept unicode or bytes.
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 18914d8..82eabf1 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -72,8 +72,11 @@
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);
}