Commits

Tyler Wade committed 6deea9f

Move sys.flags changing to applevel code

Comments (0)

Files changed (2)

pypy/bin/pyinteractive.py

                   space.wrap(argv[0]))
 
     if interactiveconfig.optimize:
-        flags_w = space.sys.get('flags').getitems_copy()
         #change the optimize flag's value
-        flags_w[6] = space.wrap(2)
-        space.appexec([space.wrap(flags_w)], """(flags):
+        space.appexec([], """():
             import sys
+            flags = list(sys.flags)
+            flags[6] = 2
             sys.flags = type(sys.flags)(flags)
         """)
 

pypy/interpreter/astcompiler/test/test_compiler.py

         assert False
         """
         w_saved_flags = space.sys.get('flags')
-        flags_w = space.sys.get('flags').getitems_copy()
-        flags_w[6] = space.wrap(1)
-        space.appexec([space.wrap(flags_w)], """(flags):
+        space.appexec([], """():
             import sys
+            flags = list(sys.flags)
+            flags[6] = 2
             sys.flags = type(sys.flags)(flags)
         """)