mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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.
This commit is contained in:
parent
5894ba7fad
commit
c4cb3b8aa1
1 changed files with 2 additions and 2 deletions
|
@ -2384,7 +2384,7 @@ PyImport_ReloadModule(PyObject *m)
|
||||||
subname = name;
|
subname = name;
|
||||||
else {
|
else {
|
||||||
PyObject *parentname, *parent;
|
PyObject *parentname, *parent;
|
||||||
parentname = PyString_FromStringAndSize(name, (subname-name));
|
parentname = PyUnicode_FromStringAndSize(name, (subname-name));
|
||||||
if (parentname == NULL) {
|
if (parentname == NULL) {
|
||||||
imp_modules_reloading_clear();
|
imp_modules_reloading_clear();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -2393,7 +2393,7 @@ PyImport_ReloadModule(PyObject *m)
|
||||||
if (parent == NULL) {
|
if (parent == NULL) {
|
||||||
PyErr_Format(PyExc_ImportError,
|
PyErr_Format(PyExc_ImportError,
|
||||||
"reload(): parent %.200s not in sys.modules",
|
"reload(): parent %.200s not in sys.modules",
|
||||||
PyString_AS_STRING(parentname));
|
PyUnicode_AsString(parentname));
|
||||||
Py_DECREF(parentname);
|
Py_DECREF(parentname);
|
||||||
imp_modules_reloading_clear();
|
imp_modules_reloading_clear();
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue