Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r58178:5e7742f91b48
Date: 2012-10-17 17:20 +0200
http://bitbucket.org/pypy/pypy/changeset/5e7742f91b48/

Log:    hg merge default

diff --git a/pypy/interpreter/astcompiler/consts.py 
b/pypy/interpreter/astcompiler/consts.py
--- a/pypy/interpreter/astcompiler/consts.py
+++ b/pypy/interpreter/astcompiler/consts.py
@@ -9,13 +9,14 @@
 CO_NESTED = 0x0010
 CO_GENERATOR = 0x0020
 CO_NOFREE = 0x0040
-CO_CONTAINSGLOBALS = 0x0800
 CO_GENERATOR_ALLOWED = 0x1000
 CO_FUTURE_DIVISION = 0x2000
 CO_FUTURE_ABSOLUTE_IMPORT = 0x4000
 CO_FUTURE_WITH_STATEMENT = 0x8000
 CO_FUTURE_PRINT_FUNCTION = 0x10000
 CO_FUTURE_UNICODE_LITERALS = 0x20000
+CO_CONTAINSGLOBALS = 0x80000 # pypy-specific: need to check that it's not used
+                             # by any other flag
 
 PyCF_SOURCE_IS_UTF8 = 0x0100
 PyCF_DONT_IMPLY_DEDENT = 0x0200
diff --git a/pypy/interpreter/test/test_code.py 
b/pypy/interpreter/test/test_code.py
--- a/pypy/interpreter/test/test_code.py
+++ b/pypy/interpreter/test/test_code.py
@@ -1,5 +1,6 @@
 from pypy.conftest import gettestobjspace
 from pypy.interpreter import gateway
+from pypy.interpreter.astcompiler import consts
 import py
 
 class AppTestCodeIntrospection:
@@ -11,6 +12,7 @@
             filename = filename[:-1]
 
         cls.w_file = space.wrap(filename)
+        cls.w_CO_CONTAINSGLOBALS = space.wrap(consts.CO_CONTAINSGLOBALS)
 
     def test_attributes(self):
         def f(): pass
@@ -194,7 +196,7 @@
         assert d['f'](4).__code__.co_flags & 0x10
         assert d['f'].__code__.co_flags & 0x10 == 0
         # check for CO_CONTAINSGLOBALS
-        assert not d['f'].__code__.co_flags & 0x0800
+        assert not d['f'].__code__.co_flags & self.CO_CONTAINSGLOBALS
 
 
         exec("""if 1:
@@ -206,8 +208,8 @@
 """, d)
 
         # check for CO_CONTAINSGLOBALS
-        assert d['f'].__code__.co_flags & 0x0800
-        assert not d['g'].__code__.co_flags & 0x0800
+        assert d['f'].__code__.co_flags & self.CO_CONTAINSGLOBALS
+        assert not d['g'].__code__.co_flags & self.CO_CONTAINSGLOBALS
 
         exec("""if 1:
         b = 2
@@ -216,4 +218,4 @@
             return a + b + x
 """, d)
         # check for CO_CONTAINSGLOBALS
-        assert d['f'].__code__.co_flags & 0x0800
+        assert d['f'].__code__.co_flags & self.CO_CONTAINSGLOBALS
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to