aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/python/pyrun.swg6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/python/pyrun.swg b/Lib/python/pyrun.swg
index 3e9aafdc2..6ce5f656e 100644
--- a/Lib/python/pyrun.swg
+++ b/Lib/python/pyrun.swg
@@ -405,6 +405,12 @@ SWIG_InstallConstants(PyObject *d, swig_const_info constants[]) {
#endif
+/* Contract support */
+
+#define SWIG_preassert(x) if (!(x)) { PyErr_SetString(PyExc_RuntimeError, "preassertion failure: " #x); goto fail; } else
+#define SWIG_postassert(x) if (!(x)) { PyErr_SetString(PyExc_RuntimeError, "postassertion failure: " #x); goto fail; } else
+#define SWIG_invarassert(x) if (!(x)) { PyErr_SetString(PyExc_RuntimeError, "invariant failure: " #x); goto fail; } else
+
#ifdef __cplusplus
}
#endif