[pypy-commit] pypy stdlib-3.2.5: pypy has no switchinterval and the test passes without.

amauryfa noreply at buildbot.pypy.org
Wed Apr 2 02:58:08 CEST 2014


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: stdlib-3.2.5
Changeset: r70389:1154666cbe9b
Date: 2014-04-02 00:24 +0200
http://bitbucket.org/pypy/pypy/changeset/1154666cbe9b/

Log:	pypy has no switchinterval and the test passes without.

diff --git a/lib-python/3/test/test_concurrent_futures.py b/lib-python/3/test/test_concurrent_futures.py
--- a/lib-python/3/test/test_concurrent_futures.py
+++ b/lib-python/3/test/test_concurrent_futures.py
@@ -294,14 +294,16 @@
         event = threading.Event()
         def future_func():
             event.wait()
-        oldswitchinterval = sys.getswitchinterval()
-        sys.setswitchinterval(1e-6)
+        if hasattr(sys, 'setswitchinterval'):
+            oldswitchinterval = sys.getswitchinterval()
+            sys.setswitchinterval(1e-6)
         try:
             fs = {self.executor.submit(future_func) for i in range(100)}
             event.set()
             futures.wait(fs, return_when=futures.ALL_COMPLETED)
         finally:
-            sys.setswitchinterval(oldswitchinterval)
+            if hasattr(sys, 'setswitchinterval'):
+                sys.setswitchinterval(oldswitchinterval)
 
 
 class ProcessPoolWaitTests(ProcessPoolMixin, WaitTests):


More information about the pypy-commit mailing list