Files
pycapnp/capnp/helpers/exception.h
Adeeb Shihadeh 5befba15f3 Minimal pycapnp
2026-09-21 18:57:37 -07:00

19 lines
297 B
C++

#pragma once
#include <Python.h>
#include <kj/exception.h>
#include <stdexcept>
class GILAcquire {
public:
GILAcquire() : gstate(PyGILState_Ensure()) {}
~GILAcquire() {
PyGILState_Release(gstate);
}
PyGILState_STATE gstate;
};
void c_reraise_kj_exception();
void init_capnp_api();