summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_threading.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2009-11-13 22:19:19 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2009-11-13 22:19:19 (GMT)
commitc3b0757b026955e4421e49ca841b9350b4faebc4 (patch)
tree322559b909fb94397bd7d740aed1fb50983b8dbd /Lib/test/test_threading.py
parent589c2d39c70b5695ed3447769939cc4e6cc660a8 (diff)
downloadcpython-c3b0757b026955e4421e49ca841b9350b4faebc4.zip
cpython-c3b0757b026955e4421e49ca841b9350b4faebc4.tar.gz
cpython-c3b0757b026955e4421e49ca841b9350b4faebc4.tar.bz2
Silence getcheckinterval()-related warnings in the test suite
Diffstat (limited to 'Lib/test/test_threading.py')
-rw-r--r--Lib/test/test_threading.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index c5d8d79..0b37059 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -342,12 +342,10 @@ class ThreadTests(BaseTestCase):
# Try hard to trigger #1703448: a thread is still returned in
# threading.enumerate() after it has been join()ed.
enum = threading.enumerate
- old_interval = sys.getcheckinterval()
+ old_interval = sys.getswitchinterval()
try:
for i in range(1, 100):
- # Try a couple times at each thread-switching interval
- # to get more interleavings.
- sys.setcheckinterval(i // 5)
+ sys.setswitchinterval(i * 0.0002)
t = threading.Thread(target=lambda: None)
t.start()
t.join()
@@ -355,7 +353,7 @@ class ThreadTests(BaseTestCase):
self.assertFalse(t in l,
"#1703448 triggered after %d trials: %s" % (i, l))
finally:
- sys.setcheckinterval(old_interval)
+ sys.setswitchinterval(old_interval)
def test_no_refcycle_through_target(self):
class RunSelfFunction(object):