[pypy-commit] pypy default: technically we should always have mandatory __future__ flags

gutworth noreply at buildbot.pypy.org
Thu Jul 14 15:47:02 CEST 2011


Author: Benjamin Peterson <benjamin at python.org>
Branch: 
Changeset: r45595:311ced346dbb
Date: 2011-07-14 08:51 -0500
http://bitbucket.org/pypy/pypy/changeset/311ced346dbb/

Log:	technically we should always have mandatory __future__ flags

diff --git a/pypy/interpreter/pycompiler.py b/pypy/interpreter/pycompiler.py
--- a/pypy/interpreter/pycompiler.py
+++ b/pypy/interpreter/pycompiler.py
@@ -119,6 +119,7 @@
             raise OperationError(self.space.w_TypeError, self.space.wrap(
                 "invalid node type"))
 
+        flags |= self.future_flags.mandatory_flags
         fut = misc.parse_future(node, self.future_flags.compiler_features)
         f_flags, f_lineno, f_col = fut
         future_pos = f_lineno, f_col
@@ -137,6 +138,7 @@
         return code
 
     def compile_to_ast(self, source, filename, mode, flags):
+        flags |= self.future_flags.mandatory_flags
         info = pyparse.CompileInfo(filename, mode, flags)
         return self._compile_to_ast(source, info)
 
@@ -154,6 +156,7 @@
         return mod
 
     def compile(self, source, filename, mode, flags, hidden_applevel=False):
+        flags |= self.future_flags.mandatory_flags
         info = pyparse.CompileInfo(filename, mode, flags,
                                    hidden_applevel=hidden_applevel)
         mod = self._compile_to_ast(source, info)


More information about the pypy-commit mailing list