diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-06-25 01:01:08 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-25 01:01:08 (GMT) |
commit | 36456df13843c5b8a1fb5a6022ab9ed1fe2a11c5 (patch) | |
tree | 72d392c36e3deeff6a76966ecffca4623a1e72d6 /Python/sysmodule.c | |
parent | 9fc720e5e4f772598013ea48a3f0d22b2b6b04fa (diff) | |
download | cpython-36456df13843c5b8a1fb5a6022ab9ed1fe2a11c5.zip cpython-36456df13843c5b8a1fb5a6022ab9ed1fe2a11c5.tar.gz cpython-36456df13843c5b8a1fb5a6022ab9ed1fe2a11c5.tar.bz2 |
bpo-37392: Remove sys.setcheckinterval() (GH-14355)
Remove sys.getcheckinterval() and sys.setcheckinterval() functions.
They were deprecated since Python 3.2. Use sys.getswitchinterval()
and sys.setswitchinterval() instead.
Remove also check_interval field of the PyInterpreterState structure.
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r-- | Python/sysmodule.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index d1a6c6a..c9718d9 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1025,56 +1025,6 @@ sys_getprofile_impl(PyObject *module) return temp; } -/*[clinic input] -sys.setcheckinterval - - n: int - / - -Set the async event check interval to n instructions. - -This tells the Python interpreter to check for asynchronous events -every n instructions. - -This also affects how often thread switches occur. -[clinic start generated code]*/ - -static PyObject * -sys_setcheckinterval_impl(PyObject *module, int n) -/*[clinic end generated code: output=3f686cef07e6e178 input=7a35b17bf22a6227]*/ -{ - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "sys.getcheckinterval() and sys.setcheckinterval() " - "are deprecated. Use sys.setswitchinterval() " - "instead.", 1) < 0) { - return NULL; - } - - PyThreadState *tstate = _PyThreadState_GET(); - tstate->interp->check_interval = n; - Py_RETURN_NONE; -} - -/*[clinic input] -sys.getcheckinterval - -Return the current check interval; see sys.setcheckinterval(). -[clinic start generated code]*/ - -static PyObject * -sys_getcheckinterval_impl(PyObject *module) -/*[clinic end generated code: output=1b5060bf2b23a47c input=4b6589cbcca1db4e]*/ -{ - if (PyErr_WarnEx(PyExc_DeprecationWarning, - "sys.getcheckinterval() and sys.setcheckinterval() " - "are deprecated. Use sys.getswitchinterval() " - "instead.", 1) < 0) { - return NULL; - } - - PyThreadState *tstate = _PyThreadState_GET(); - return PyLong_FromLong(tstate->interp->check_interval); -} /*[clinic input] sys.setswitchinterval @@ -1990,8 +1940,6 @@ static PyMethodDef sys_methods[] = { SYS_INTERN_METHODDEF SYS_IS_FINALIZING_METHODDEF SYS_MDEBUG_METHODDEF - SYS_SETCHECKINTERVAL_METHODDEF - SYS_GETCHECKINTERVAL_METHODDEF SYS_SETSWITCHINTERVAL_METHODDEF SYS_GETSWITCHINTERVAL_METHODDEF SYS_SETDLOPENFLAGS_METHODDEF @@ -2430,7 +2378,6 @@ getrefcount() -- return the reference count for an object (plus one :-)\n\ getrecursionlimit() -- return the max recursion depth for the interpreter\n\ getsizeof() -- return the size of an object in bytes\n\ gettrace() -- get the global debug tracing function\n\ -setcheckinterval() -- control how often the interpreter checks for events\n\ setdlopenflags() -- set the flags to be used for dlopen() calls\n\ setprofile() -- set the global profiling function\n\ setrecursionlimit() -- set the max recursion depth for the interpreter\n\ |