Author: Armin Rigo <ar...@tunes.org>
Branch: guard-compatible
Changeset: r90008:5d42d925abed
Date: 2017-02-08 11:12 +0100
http://bitbucket.org/pypy/pypy/changeset/5d42d925abed/

Log:    avoid interaction with other usages of random.random()

diff --git a/rpython/rlib/jit.py b/rpython/rlib/jit.py
--- a/rpython/rlib/jit.py
+++ b/rpython/rlib/jit.py
@@ -397,11 +397,12 @@
     def setup_method(self, meth):
         global _we_are_jitted_interpreted
         seed = random.random()
-        print "seed", seed
-        random.seed(seed)
+        print "RandomWeAreJittedTestMixin: seed", seed
+        r = random.Random()
+        r.seed(seed)
         self.orig_we_are_jitted = _we_are_jitted_interpreted
         def _we_are_jitted_interpreted_random():
-            result = random.random() > 0.5
+            result = r.random() > 0.5
             return result
         _we_are_jitted_interpreted = _we_are_jitted_interpreted_random
 
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to