[pypy-commit] pypy default: don't give all frames a .builtin module, even if honor__builtins__ is False

cfbolz noreply at buildbot.pypy.org
Wed Jan 28 18:49:39 CET 2015


Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: 
Changeset: r75572:a7ee096c07bf
Date: 2015-01-28 18:48 +0100
http://bitbucket.org/pypy/pypy/changeset/a7ee096c07bf/

Log:	don't give all frames a .builtin module, even if honor__builtins__
	is False (the default).

	__setstate__ was forcing the existence of that attribute.

diff --git a/pypy/interpreter/pyframe.py b/pypy/interpreter/pyframe.py
--- a/pypy/interpreter/pyframe.py
+++ b/pypy/interpreter/pyframe.py
@@ -439,7 +439,10 @@
         f_back = space.interp_w(PyFrame, w_f_back, can_be_None=True)
         new_frame.f_backref = jit.non_virtual_ref(f_back)
 
-        new_frame.builtin = space.interp_w(Module, w_builtin)
+        if space.config.objspace.honor__builtins__:
+            new_frame.builtin = space.interp_w(Module, w_builtin)
+        else:
+            assert space.interp_w(Module, w_builtin) is space.builtin
         new_frame.set_blocklist([unpickle_block(space, w_blk)
                                  for w_blk in space.unpackiterable(w_blockstack)])
         values_w = maker.slp_from_tuple_with_nulls(space, w_valuestack)


More information about the pypy-commit mailing list