Author: Manuel Jacob <m...@manueljacob.de>
Branch: py3k
Changeset: r82330:1bf2ad223b9c
Date: 2016-02-19 20:58 +0100
http://bitbucket.org/pypy/pypy/changeset/1bf2ad223b9c/

Log:    Add exec() workaround for running on top of old CPython 2.7
        versions.

diff --git a/pypy/module/__pypy__/test/test_magic.py 
b/pypy/module/__pypy__/test/test_magic.py
--- a/pypy/module/__pypy__/test/test_magic.py
+++ b/pypy/module/__pypy__/test/test_magic.py
@@ -15,6 +15,10 @@
         __pypy__.save_module_content_for_future_reload(sys)
 
     def test_new_code_hook(self):
+        # workaround for running on top of old CPython 2.7 versions
+        def exec_(code, d):
+            exec(code, d)
+
         l = []
 
         def callable(code):
@@ -24,7 +28,7 @@
         __pypy__.set_code_callback(callable)
         d = {}
         try:
-            exec("""
+            exec_("""
 def f():
     pass
 """, d)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to