[pypy-commit] benchmarks default: be fair to jython
Raemi
noreply at buildbot.pypy.org
Thu May 29 11:27:38 CEST 2014
Author: Remi Meier <remi.meier at inf.ethz.ch>
Branch:
Changeset: r263:a26f2fb58413
Date: 2014-05-29 11:27 +0200
http://bitbucket.org/pypy/benchmarks/changeset/a26f2fb58413/
Log: be fair to jython
diff --git a/multithread/raytrace/raytrace.py b/multithread/raytrace/raytrace.py
--- a/multithread/raytrace/raytrace.py
+++ b/multithread/raytrace/raytrace.py
@@ -7,10 +7,19 @@
print_abort_info, hint_commit_soon)
import time
+import platform
+if platform.python_implementation() == "Jython":
+ # be fair to jython and don't use a lock where none is required:
+ class fakeatomic:
+ def __enter__(self):
+ pass
+ def __exit__(self,*args):
+ pass
+ atomic = fakeatomic()
+
+
AMBIENT = 0.1
-
-
class Vector(object):
def __init__(self,x,y,z):
self.x = x
More information about the pypy-commit
mailing list