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.
This commit is contained in:
Victor Stinner 2019-06-25 03:01:08 +02:00 committed by GitHub
parent 9fc720e5e4
commit 36456df138
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 148 deletions

View file

@ -159,15 +159,6 @@ class SysModuleTest(unittest.TestCase):
# testing sys.settrace() is done in test_sys_settrace.py
# testing sys.setprofile() is done in test_sys_setprofile.py
def test_setcheckinterval(self):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
self.assertRaises(TypeError, sys.setcheckinterval)
orig = sys.getcheckinterval()
for n in 0, 100, 120, orig: # orig last to restore starting state
sys.setcheckinterval(n)
self.assertEqual(sys.getcheckinterval(), n)
def test_switchinterval(self):
self.assertRaises(TypeError, sys.setswitchinterval)
self.assertRaises(TypeError, sys.setswitchinterval, "a")