summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2009-03-19 18:03:49 -1000
committerDavid Cantrell <dcantrell@redhat.com>2009-03-19 18:55:19 -1000
commit257f4aeb8c0e2f5c9d3b4595eeb486f093a2219e (patch)
tree6e91edaab13a3dc60672b0196280aeb52afd0385 /isys
parent9255f1e75e41b60df086bd37c82e1aa77d4d42f2 (diff)
downloadanaconda-257f4aeb8c0e2f5c9d3b4595eeb486f093a2219e.tar.gz
anaconda-257f4aeb8c0e2f5c9d3b4595eeb486f093a2219e.tar.xz
anaconda-257f4aeb8c0e2f5c9d3b4595eeb486f093a2219e.zip
If we have no error string, place None in the tuple.
Be more defensive about what we get back from the _isys module. Do not assume we get an error string. If it's empty, place None in the tuple.
Diffstat (limited to 'isys')
-rw-r--r--isys/isys.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/isys/isys.c b/isys/isys.c
index 0813e5054..65ee688b3 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -291,7 +291,14 @@ static PyObject * doMount(PyObject * s, PyObject * args) {
PyObject *tuple = PyTuple_New(2);
PyTuple_SetItem(tuple, 0, PyInt_FromLong(rc));
- PyTuple_SetItem(tuple, 1, PyString_FromString(err));
+
+ if (err == NULL) {
+ Py_INCREF(Py_None);
+ PyTuple_SetItem(tuple, 1, Py_None);
+ } else {
+ PyTuple_SetItem(tuple, 1, PyString_FromString(err));
+ }
+
PyErr_SetObject(PyExc_SystemError, tuple);
}