mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
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:
parent
9fc720e5e4
commit
36456df138
9 changed files with 14 additions and 148 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue