Mercurial > cpython-lru_cache-weakref
diff Objects/moduleobject.c @ 41595:2c54763c4504
More coding by random modification.
Encoding now return bytes instead of str8.
eval(), exec(), compile() now accept unicode or bytes.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 04 May 2007 00:41:39 +0000 |
| parents | 29ae667f3239 |
| children | c9c52b87c30b |
line wrap: on
line diff
--- a/Objects/moduleobject.c Thu May 03 21:11:35 2007 +0000 +++ b/Objects/moduleobject.c Fri May 04 00:41:39 2007 +0000 @@ -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); }
