Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 43762:de3b63f8b17b
Applied patch #1379 with a minor tweak.
PyModule_GetName() returns a char* from PyUnicode_AsString but the code in import.c was using PyString_FromString on it.
| author | Christian Heimes <christian@cheimes.de> |
|---|---|
| date | Sun, 04 Nov 2007 12:10:01 +0000 |
| parents | 00b136b7da84 |
| children | 0d462d789b18 |
line wrap: on
line diff
--- a/Python/import.c Sun Nov 04 11:43:14 2007 +0000 +++ b/Python/import.c Sun Nov 04 12:10:01 2007 +0000 @@ -2384,7 +2384,7 @@ subname = name; else { PyObject *parentname, *parent; - parentname = PyString_FromStringAndSize(name, (subname-name)); + parentname = PyUnicode_FromStringAndSize(name, (subname-name)); if (parentname == NULL) { imp_modules_reloading_clear(); return NULL; @@ -2393,7 +2393,7 @@ if (parent == NULL) { PyErr_Format(PyExc_ImportError, "reload(): parent %.200s not in sys.modules", - PyString_AS_STRING(parentname)); + PyUnicode_AsString(parentname)); Py_DECREF(parentname); imp_modules_reloading_clear(); return NULL;
