From: Mark Wooding Date: Wed, 1 Jan 2014 17:32:59 +0000 (+0000) Subject: key.c (keyexc_raise): Put the error text in the exception. X-Git-Tag: 1.0.6~1 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/d5a321e82f2f8fa992cbe7deb12b0d0027511056?ds=inline key.c (keyexc_raise): Put the error text in the exception. Makes it much easier for humans who are just given the raw exception backtrace. --- diff --git a/key.c b/key.c index c4ccfa9..2af0019 100644 --- a/key.c +++ b/key.c @@ -104,7 +104,7 @@ static PyMethodDef keyexc_pymethods[] = { static void keyexc_raise(int err) { - PyObject *arg = Py_BuildValue("(i)", err); + PyObject *arg = Py_BuildValue("(is)", err, key_strerror(err)); if (arg) PyErr_SetObject(keyexc, arg); Py_XDECREF(arg); }