Expose the exceptions thrown by xen.lowlevel.xc so they can be caught.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori committed 2006-05-19 17:31:28 +01:00
1 parent 71fd91f9ba
commit 0111c4bb06
1 file changed
+5 -2
+5 -2
View File
@@ -1172,7 +1172,7 @@ static int
PyXc_init(XcObject *self, PyObject *args, PyObject *kwds)
{
if ((self->xc_handle = xc_interface_open()) == -1) {
PyErr_SetFromErrno(PyExc_RuntimeError);
PyErr_SetFromErrno(xc_error);
return -1;
}
@@ -1245,7 +1245,7 @@ PyMODINIT_FUNC initxc(void)
if (m == NULL)
return;
xc_error = PyErr_NewException(PKG ".error", NULL, NULL);
xc_error = PyErr_NewException(PKG ".Error", PyExc_RuntimeError, NULL);
zero = PyInt_FromLong(0);
/* KAF: This ensures that we get debug output in a timely manner. */
@@ -1254,6 +1254,9 @@ PyMODINIT_FUNC initxc(void)
Py_INCREF(&PyXcType);
PyModule_AddObject(m, CLS, (PyObject *)&PyXcType);
Py_INCREF(xc_error);
PyModule_AddObject(m, "Error", xc_error);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.