From 18e245ad0b6ee99f23e2ed67c150413295c69c1f Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Sat, 17 Feb 2007 20:27:11 -0800 Subject: Pass an exception from a python event through the event queue back into python so we don't just silently ignore those errors --HG-- extra : convert_revision : e2f5566a4681f1b8ea80af50071119118afa7d8a --- src/python/swig/pyevent.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/python/swig/pyevent.cc') diff --git a/src/python/swig/pyevent.cc b/src/python/swig/pyevent.cc index 6fb7d3f17..7f23b8874 100644 --- a/src/python/swig/pyevent.cc +++ b/src/python/swig/pyevent.cc @@ -31,6 +31,7 @@ #include #include "python/swig/pyevent.hh" +#include "sim/async.hh" PythonEvent::PythonEvent(PyObject *obj, Tick when, Priority priority) : Event(&mainEventQueue, priority), object(obj) @@ -52,9 +53,9 @@ PythonEvent::~PythonEvent() void PythonEvent::process() { - PyObject *result; - - result = PyObject_CallMethod(object, "process", ""); + PyObject *args = PyTuple_New(0); + PyObject *result = PyObject_Call(object, args, NULL); + Py_DECREF(args); if (result) { // Nothing to do just decrement the reference count @@ -62,5 +63,7 @@ PythonEvent::process() } else { // Somethign should be done to signal back to the main interpreter // that there's been an exception. + async_event = true; + async_exception = true; } } -- cgit v1.2.3