mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
python: check return value of PyErr_NewException
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com> Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
1 parent
9442404b91
commit
6b28df34b5
2 files changed
+8
No files matched your search
@@ -2735,6 +2735,10 @@ PyMODINIT_FUNC initxc(void)
|
||||
return;
|
||||
|
||||
xc_error_obj = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
|
||||
if (xc_error_obj == NULL) {
|
||||
Py_DECREF(m);
|
||||
return;
|
||||
}
|
||||
zero = PyInt_FromLong(0);
|
||||
|
||||
/* KAF: This ensures that we get debug output in a timely manner. */
|
||||
|
||||
@@ -987,6 +987,10 @@ PyMODINIT_FUNC initxs(void)
|
||||
return;
|
||||
|
||||
xs_error = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
|
||||
if (xs_error == NULL) {
|
||||
Py_DECREF(m);
|
||||
return;
|
||||
}
|
||||
|
||||
Py_INCREF(&xshandle_type);
|
||||
PyModule_AddObject(m, CLS, (PyObject *)&xshandle_type);
|
||||
|
||||