Author: Ronan Lamy <[email protected]>
Branch: Opcode-class
Changeset: r64020:945b1a989902
Date: 2013-05-12 15:17 +0100
http://bitbucket.org/pypy/pypy/changeset/945b1a989902/

Log:    Remove unnecessary guard

        The special case in space.setitem was never actually executed, since
        frame.w_globals is never modified directly and other ways of
        accessing globals() don't return the frame.w_globals object.

diff --git a/rpython/flowspace/objspace.py b/rpython/flowspace/objspace.py
--- a/rpython/flowspace/objspace.py
+++ b/rpython/flowspace/objspace.py
@@ -305,14 +305,6 @@
         frame.handle_implicit_exceptions([StopIteration, RuntimeError])
         return w_item
 
-    def setitem(self, w_obj, w_key, w_val):
-        # protect us from globals write access
-        if w_obj is self.frame.w_globals:
-            raise FlowingError(self.frame,
-                    "Attempting to modify global variable  %r." % (w_key))
-        return self.frame.do_operation_with_implicit_exceptions('setitem',
-                w_obj, w_key, w_val)
-
     def setitem_str(self, w_obj, key, w_value):
         return self.setitem(w_obj, self.wrap(key), w_value)
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to