summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/python/pybind11/event.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/python/pybind11/event.cc b/src/python/pybind11/event.cc
index f9e65685d..88ee6996a 100644
--- a/src/python/pybind11/event.cc
+++ b/src/python/pybind11/event.cc
@@ -135,7 +135,10 @@ pybind_init_event(py::module &m_native)
std::unique_ptr<GlobalSimLoopExitEvent, py::nodelete>>(
m, "GlobalSimLoopExitEvent")
.def("getCause", &GlobalSimLoopExitEvent::getCause)
- .def("getCode", &GlobalSimLoopExitEvent::getCode)
+ .def("getCode", [](GlobalSimLoopExitEvent *e) {
+ return py::reinterpret_steal<py::object>(
+ PyInt_FromLong(e->getCode()));
+ })
;
// Event base class. These should never be returned directly to