[pypy-commit] pypy default: Backout the change to use mandatory flags everywhere, this breaks relative imports, as absolute import is marked as mandator in 2.7, but it obviously isn't. Further, CPython doesn't seem to do it, and I can't find any actual advantage to it.

alex_gaynor noreply at buildbot.pypy.org
Fri Jul 15 05:16:39 CEST 2011


Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: 
Changeset: r45604:80dc3701fb24
Date: 2011-07-14 20:15 -0700
http://bitbucket.org/pypy/pypy/changeset/80dc3701fb24/

Log:	Backout the change to use mandatory flags everywhere, this breaks
	relative imports, as absolute import is marked as mandator in 2.7,
	but it obviously isn't. Further, CPython doesn't seem to do it, and
	I can't find any actual advantage to it.

diff --git a/pypy/interpreter/pycompiler.py b/pypy/interpreter/pycompiler.py
--- a/pypy/interpreter/pycompiler.py
+++ b/pypy/interpreter/pycompiler.py
@@ -119,7 +119,6 @@
             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
@@ -138,7 +137,6 @@
         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)
 
@@ -156,7 +154,6 @@
         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