[pypy-svn] r76387 - in pypy/trunk/pypy: interpreter/astcompiler module/__builtin__ module/_ast module/_ast/test

fijal at codespeak.net fijal at codespeak.net
Thu Jul 29 15:02:28 CEST 2010


Author: fijal
Date: Thu Jul 29 15:02:27 2010
New Revision: 76387

Modified:
   pypy/trunk/pypy/interpreter/astcompiler/consts.py
   pypy/trunk/pypy/module/__builtin__/compiling.py
   pypy/trunk/pypy/module/_ast/__init__.py
   pypy/trunk/pypy/module/_ast/test/test_ast.py
Log:
Rename the flag to be the same as CPython and not with a typo :-/


Modified: pypy/trunk/pypy/interpreter/astcompiler/consts.py
==============================================================================
--- pypy/trunk/pypy/interpreter/astcompiler/consts.py	(original)
+++ pypy/trunk/pypy/interpreter/astcompiler/consts.py	Thu Jul 29 15:02:27 2010
@@ -18,4 +18,4 @@
 
 PyCF_SOURCE_IS_UTF8 = 0x0100
 PyCF_DONT_IMPLY_DEDENT = 0x0200
-PyCF_AST_ONLY = 0x0400
+PyCF_ONLY_AST = 0x0400

Modified: pypy/trunk/pypy/module/__builtin__/compiling.py
==============================================================================
--- pypy/trunk/pypy/module/__builtin__/compiling.py	(original)
+++ pypy/trunk/pypy/module/__builtin__/compiling.py	Thu Jul 29 15:02:27 2010
@@ -38,7 +38,7 @@
         str_ = space.str_w(w_source)
 
     ec = space.getexecutioncontext()
-    if flags & ~(ec.compiler.compiler_flags | consts.PyCF_AST_ONLY |
+    if flags & ~(ec.compiler.compiler_flags | consts.PyCF_ONLY_AST |
                  consts.PyCF_DONT_IMPLY_DEDENT | consts.PyCF_SOURCE_IS_UTF8):
         raise OperationError(space.w_ValueError,
                              space.wrap("compile() unrecognized flags"))
@@ -53,7 +53,7 @@
                                         "or 'eval' or 'single'"))
 
     if ast_node is None:
-        if flags & consts.PyCF_AST_ONLY:
+        if flags & consts.PyCF_ONLY_AST:
             mod = ec.compiler.compile_to_ast(str_, filename, mode, flags)
             return space.wrap(mod)
         else:

Modified: pypy/trunk/pypy/module/_ast/__init__.py
==============================================================================
--- pypy/trunk/pypy/module/_ast/__init__.py	(original)
+++ pypy/trunk/pypy/module/_ast/__init__.py	Thu Jul 29 15:02:27 2010
@@ -5,7 +5,7 @@
 class Module(MixedModule):
 
     interpleveldefs = {
-        "PyCF_AST_ONLY" : "space.wrap(%s)" % consts.PyCF_AST_ONLY
+        "PyCF_ONLY_AST" : "space.wrap(%s)" % consts.PyCF_ONLY_AST
         }
     appleveldefs = {}
 

Modified: pypy/trunk/pypy/module/_ast/test/test_ast.py
==============================================================================
--- pypy/trunk/pypy/module/_ast/test/test_ast.py	(original)
+++ pypy/trunk/pypy/module/_ast/test/test_ast.py	Thu Jul 29 15:02:27 2010
@@ -10,7 +10,7 @@
         cls.w_get_ast = cls.space.appexec([], """():
     def get_ast(source, mode="exec"):
         import _ast as ast
-        mod = compile(source, "<test>", mode, ast.PyCF_AST_ONLY)
+        mod = compile(source, "<test>", mode, ast.PyCF_ONLY_AST)
         assert isinstance(mod, ast.mod)
         return mod
     return get_ast""")



More information about the Pypy-commit mailing list