Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 29765:e9e5832d706f legacy-trunk
New function sys.getcheckinterval(), to complement setcheckinterval().
| author | Tim Peters <tim.peters@gmail.com> |
|---|---|
| date | Sun, 06 Jul 2003 18:36:54 +0000 |
| parents | bf1634b023d5 |
| children | a88e6dfbfd6d |
comparison
equal
deleted
inserted
replaced
| 29764:fe5eb17800f9 | 29765:e9e5832d706f |
|---|---|
| 430 Tell the Python interpreter to check for asynchronous events every\n\ | 430 Tell the Python interpreter to check for asynchronous events every\n\ |
| 431 n instructions. This also affects how often thread switches occur." | 431 n instructions. This also affects how often thread switches occur." |
| 432 ); | 432 ); |
| 433 | 433 |
| 434 static PyObject * | 434 static PyObject * |
| 435 sys_getcheckinterval(PyObject *self, PyObject *args) | |
| 436 { | |
| 437 return PyInt_FromLong(_Py_CheckInterval); | |
| 438 } | |
| 439 | |
| 440 PyDoc_STRVAR(getcheckinterval_doc, | |
| 441 "getcheckinterval() -> current check interval; see setcheckinterval()." | |
| 442 ); | |
| 443 | |
| 444 static PyObject * | |
| 435 sys_setrecursionlimit(PyObject *self, PyObject *args) | 445 sys_setrecursionlimit(PyObject *self, PyObject *args) |
| 436 { | 446 { |
| 437 int new_limit; | 447 int new_limit; |
| 438 if (!PyArg_ParseTuple(args, "i:setrecursionlimit", &new_limit)) | 448 if (!PyArg_ParseTuple(args, "i:setrecursionlimit", &new_limit)) |
| 439 return NULL; | 449 return NULL; |
| 721 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, | 731 {"setdefaultencoding", sys_setdefaultencoding, METH_VARARGS, |
| 722 setdefaultencoding_doc}, | 732 setdefaultencoding_doc}, |
| 723 #endif | 733 #endif |
| 724 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, | 734 {"setcheckinterval", sys_setcheckinterval, METH_VARARGS, |
| 725 setcheckinterval_doc}, | 735 setcheckinterval_doc}, |
| 736 {"getcheckinterval", sys_getcheckinterval, METH_NOARGS, | |
| 737 getcheckinterval_doc}, | |
| 726 #ifdef HAVE_DLOPEN | 738 #ifdef HAVE_DLOPEN |
| 727 {"setdlopenflags", sys_setdlopenflags, METH_VARARGS, | 739 {"setdlopenflags", sys_setdlopenflags, METH_VARARGS, |
| 728 setdlopenflags_doc}, | 740 setdlopenflags_doc}, |
| 729 #endif | 741 #endif |
| 730 {"setprofile", sys_setprofile, METH_O, setprofile_doc}, | 742 {"setprofile", sys_setprofile, METH_O, setprofile_doc}, |
