or when \code{os._exit()} is called.}
\end{datadesc}
+\begin{funcdesc}{getcheckinterval}{}
+ Return the interpreter's ``check interval'';
+ see \function{setcheckinterval()}.
+\end{funcdesc}
+
\begin{funcdesc}{getdefaultencoding}{}
Return the name of the current default string encoding used by the
Unicode implementation.
def test_setcheckinterval(self):
self.assertRaises(TypeError, sys.setcheckinterval)
- sys.setcheckinterval(120)
- sys.setcheckinterval(100)
+ orig = sys.getcheckinterval()
+ for n in 0, 100, 120, orig: # orig last to restore starting state
+ sys.setcheckinterval(n)
+ self.assertEquals(sys.getcheckinterval(), n)
def test_recursionlimit(self):
self.assertRaises(TypeError, sys.getrecursionlimit, 42)
Core and builtins
-----------------
+- The new function sys.getcheckinterval() returns the last value set
+ by sys.setcheckinterval().
+
- The Windows implementation of PyThread_start_new_thread() never
checked error returns from Windows functions correctly. As a result,
it could claim to start a new thread even when the Microsoft
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)
{
#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},