From 257f4aeb8c0e2f5c9d3b4595eeb486f093a2219e Mon Sep 17 00:00:00 2001 From: David Cantrell Date: Thu, 19 Mar 2009 18:03:49 -1000 Subject: 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. --- isys/isys.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'isys') 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); } -- cgit