+// This macro can be used to disable the releasing of the GIL when calling the
+// C++ function. This is like using threadWrapperOff for just this function.
+%define KeepGIL(name)
+%exception name {
+ $action
+ if (PyErr_Occurred()) SWIG_fail;
+}
+%enddef
+