Tidy up handling of OOM exceptions - Py*_New will call PyErr_NoMemory() internally, so there is no need to call it again here, just correctly handle the NULL return value
This commit is contained in:
parent
04a0b526eb
commit
4f453e0cde
1 changed files with 1 additions and 5 deletions
|
|
@ -296,7 +296,6 @@ SwigPyClientData_New(PyObject* obj)
|
||||||
Py_DECREF(data->newraw);
|
Py_DECREF(data->newraw);
|
||||||
Py_DECREF(data->klass);
|
Py_DECREF(data->klass);
|
||||||
free(data);
|
free(data);
|
||||||
PyErr_NoMemory();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -355,10 +354,7 @@ SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
|
||||||
if (!sobj->dict)
|
if (!sobj->dict)
|
||||||
sobj->dict = PyDict_New();
|
sobj->dict = PyDict_New();
|
||||||
|
|
||||||
if (!sobj->dict)
|
Py_XINCREF(sobj->dict);
|
||||||
return PyErr_NoMemory();
|
|
||||||
|
|
||||||
Py_INCREF(sobj->dict);
|
|
||||||
return sobj->dict;
|
return sobj->dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue