mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
fix refcnt/style/debuging oversights
This commit is contained in:
parent
94c001b503
commit
da20cd2b6b
1 changed files with 7 additions and 5 deletions
|
@ -593,13 +593,15 @@ PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
|
||||||
if (msg == NULL)
|
if (msg == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
args = PyTuple_New(1);
|
args = PyTuple_New(0);
|
||||||
if (args == NULL)
|
if (args == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
kwargs = PyDict_New();
|
kwargs = PyDict_New();
|
||||||
if (kwargs == NULL)
|
if (kwargs == NULL) {
|
||||||
|
Py_DECREF(args);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (name == NULL) {
|
if (name == NULL) {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
@ -612,7 +614,7 @@ PyErr_SetImportError(PyObject *msg, PyObject *name, PyObject *path)
|
||||||
}
|
}
|
||||||
|
|
||||||
Py_INCREF(msg);
|
Py_INCREF(msg);
|
||||||
PyTuple_SetItem(args, 0, NULL);//msg);
|
PyTuple_SET_ITEM(args, 0, msg);
|
||||||
PyDict_SetItemString(kwargs, "name", name);
|
PyDict_SetItemString(kwargs, "name", name);
|
||||||
PyDict_SetItemString(kwargs, "path", path);
|
PyDict_SetItemString(kwargs, "path", path);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue