summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/python/eval.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sca-cpp/trunk/modules/python/eval.hpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp
index bf539faa38..65cd7f0ef7 100644
--- a/sca-cpp/trunk/modules/python/eval.hpp
+++ b/sca-cpp/trunk/modules/python/eval.hpp
@@ -66,17 +66,12 @@ const string lastError() {
PyObject* sval = PyObject_Str(val);
string msg = string() + PyString_AsString(stype) + " : " + PyString_AsString(sval);
Py_DECREF(stype);
- Py_DECREF(sval);
- Py_DECREF(type);
- Py_DECREF(val);
- Py_XDECREF(trace);
+ Py_DECREF(sval);
+ PyErr_Restore(type, val, trace);
PyErr_Print();
return msg;
}
- PyErr_Print();
- Py_XDECREF(type);
- Py_XDECREF(val);
- Py_XDECREF(trace);
+ PyErr_Restore(type, val, trace);
PyErr_Print();
return "Unknown Python error";
}