Skip to content

Commit 163d734

Browse files
committed
Catch exception in __exit__
1 parent 0cfada7 commit 163d734

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

wpilibc/src/main/python/semiwrap/Alert.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,9 @@ classes:
2222
})
2323
.def("__exit__", [](wpi::Alert &self, py::args args) {
2424
py::gil_scoped_release release;
25-
self.Set(false);
25+
try {
26+
self.Set(false);
27+
} catch (const std::runtime_error& e) {
28+
// Ignore exceptions during cleanup
29+
}
2630
})

0 commit comments

Comments
 (0)