Skip to content

Commit 351c33a

Browse files
committed
Use proper PYBIND11_OVERRIDE macros.
1 parent 1f9db33 commit 351c33a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/python_bindings.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ class Py_SyncActionNode : public SyncActionNode
2727

2828
NodeStatus tick() override
2929
{
30-
py::gil_scoped_acquire gil;
31-
return py::get_overload(this, "tick")().cast<NodeStatus>();
30+
PYBIND11_OVERRIDE_PURE_NAME(NodeStatus, Py_SyncActionNode, "tick", tick);
3231
}
3332
};
3433

@@ -41,20 +40,18 @@ class Py_StatefulActionNode final : public StatefulActionNode
4140

4241
NodeStatus onStart() override
4342
{
44-
py::gil_scoped_acquire gil;
45-
return py::get_overload(this, "on_start")().cast<NodeStatus>();
43+
PYBIND11_OVERRIDE_PURE_NAME(NodeStatus, Py_StatefulActionNode, "on_start", onStart);
4644
}
4745

4846
NodeStatus onRunning() override
4947
{
50-
py::gil_scoped_acquire gil;
51-
return py::get_overload(this, "on_running")().cast<NodeStatus>();
48+
PYBIND11_OVERRIDE_PURE_NAME(NodeStatus, Py_StatefulActionNode, "on_running",
49+
onRunning);
5250
}
5351

5452
void onHalted() override
5553
{
56-
py::gil_scoped_acquire gil;
57-
py::get_overload(this, "on_halted")();
54+
PYBIND11_OVERRIDE_PURE_NAME(void, Py_StatefulActionNode, "on_running", onRunning);
5855
}
5956
};
6057

0 commit comments

Comments
 (0)