MCPcopy Create free account
hub / github.com/pybind/pybind11 / pycatch

Function pycatch

tests/test_exceptions.py:227–231  ·  view source on GitHub ↗
(exctype, f, *args)

Source from the content-addressed store, hash-verified

225 assert str(excinfo.value) == "nested error"
226
227 def pycatch(exctype, f, *args): # noqa: ARG001
228 try:
229 f(*args)
230 except m.MyException as e:
231 print(e)
232
233 # C++ -> Python -> C++ -> Python
234 with capture:

Callers

nothing calls this directly

Calls 2

fFunction · 0.85
printFunction · 0.85

Tested by

no test coverage detected