[pypy-commit] pypy default: Copy the checkin message as comment to the newly introduced function.
arigo
noreply at buildbot.pypy.org
Fri Jul 4 00:13:02 CEST 2014
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r72351:2d41724c01ad
Date: 2014-07-04 00:12 +0200
http://bitbucket.org/pypy/pypy/changeset/2d41724c01ad/
Log: Copy the checkin message as comment to the newly introduced
function.
diff --git a/lib-python/2.7/timeit.py b/lib-python/2.7/timeit.py
--- a/lib-python/2.7/timeit.py
+++ b/lib-python/2.7/timeit.py
@@ -131,6 +131,14 @@
raise ValueError("setup is neither a string nor callable")
self.src = src # Save for traceback display
def make_inner():
+ # PyPy tweak: recompile the source code each time before
+ # calling inner(). There are situations like Issue #1776
+ # where PyPy tries to reuse the JIT code from before,
+ # but that's not going to work: the first thing the
+ # function does is the "-s" statement, which may declare
+ # new classes (here a namedtuple). We end up with
+ # bridges from the inner loop; more and more of them
+ # every time we call inner().
code = compile(src, dummy_src_name, "exec")
exec code in globals(), ns
return ns["inner"]
More information about the pypy-commit
mailing list