summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-07-06 18:36:54 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-07-06 18:36:54 (GMT)
commite5e065b6699b33244e58b798e7b17b39bf2945a0 (patch)
tree4905c09e80e5b5d238315a36de4702ac7c1c2cd7 /Python
parentd6640d4bd01874fc469c58c506527465a62d140b (diff)
downloadcpython-e5e065b6699b33244e58b798e7b17b39bf2945a0.zip
cpython-e5e065b6699b33244e58b798e7b17b39bf2945a0.tar.gz
cpython-e5e065b6699b33244e58b798e7b17b39bf2945a0.tar.bz2
New function sys.getcheckinterval(), to complement setcheckinterval().
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index edbc2bf..8c77a88 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -432,6 +432,16 @@ n instructions. This also affects how often thread switches occur."
);
static PyObject *
+sys_getcheckinterval(PyObject *self, PyObject *args)
+{
+ return PyInt_FromLong(_Py_CheckInterval);
+}
+
+PyDoc_STRVAR(getcheckinterval_doc,
+"getcheckinterval() -> current check interval; see setcheckinterval()."
+);
+
+static PyObject *
sys_setrecursionlimit(PyObject *self, PyObject *args)
{
int new_limit;
@@ -723,6 +733,8 @@ static PyMethodDef sys_methods[] = {
#endif
{"setcheckinterval", sys_setcheckinterval, METH_VARARGS,
setcheckinterval_doc},
+ {"getcheckinterval", sys_getcheckinterval, METH_NOARGS,
+ getcheckinterval_doc},
#ifdef HAVE_DLOPEN
{"setdlopenflags", sys_setdlopenflags, METH_VARARGS,
setdlopenflags_doc},