]> granicus.if.org Git - python/commitdiff
sys.checkinterval() now refreshes the current countdown ticker.
authorRaymond Hettinger <python@rcn.com>
Thu, 2 Jun 2011 01:21:42 +0000 (18:21 -0700)
committerRaymond Hettinger <python@rcn.com>
Thu, 2 Jun 2011 01:21:42 +0000 (18:21 -0700)
Misc/NEWS
Python/sysmodule.c

index 2577985c6e54a9d96e232466737226d3ab2b36bc..34d66ec87777b6eb245fef72df208e9adfdcd356 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,13 @@ Core and Builtins
 Library
 -------
 
+- sys.setcheckinterval() now updates the current ticker count as well as updating
+  the check interval, so if the user decreases the check interval, the ticker
+  doesn't have to wind down to zero from the old starting point before the new
+  interval takes effect.  And if the user increases the interval, it makes sure
+  the new limit takes effect right away rather have an early task switch before
+  recognizing the new interval.
+
 - Issue #12085: Fix an attribute error in subprocess.Popen destructor if the
   constructor has failed, e.g. because of an undeclared keyword argument. Patch
   written by Oleg Oshmyan.
index 00b3aa4fc9ae3aadc4520cfc4d4c4fe4b223347f..692805bff3c3911631772ddf428f0ccf94cfe096 100644 (file)
@@ -466,6 +466,7 @@ sys_setcheckinterval(PyObject *self, PyObject *args)
 {
     if (!PyArg_ParseTuple(args, "i:setcheckinterval", &_Py_CheckInterval))
         return NULL;
+    _Py_Ticker = _Py_CheckInterval;
     Py_INCREF(Py_None);
     return Py_None;
 }