[pypy-svn] r57503 - in pypy/branch/2.5-features/pypy/interpreter: astcompiler pyparser pyparser/test
cfbolz at codespeak.net
cfbolz at codespeak.net
Wed Aug 20 15:06:14 CEST 2008
Author: cfbolz
Date: Wed Aug 20 15:06:12 2008
New Revision: 57503
Modified:
pypy/branch/2.5-features/pypy/interpreter/astcompiler/consts.py
pypy/branch/2.5-features/pypy/interpreter/astcompiler/pycodegen.py
pypy/branch/2.5-features/pypy/interpreter/pyparser/future.py
pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_futureautomaton.py
Log:
use official name of the abs import flag
Modified: pypy/branch/2.5-features/pypy/interpreter/astcompiler/consts.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/astcompiler/consts.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/astcompiler/consts.py Wed Aug 20 15:06:12 2008
@@ -19,5 +19,5 @@
CO_GENERATOR = 0x0020
CO_GENERATOR_ALLOWED = 0x1000
CO_FUTURE_DIVISION = 0x2000
-CO_FUTURE_ABSIMPORT = 0x4000
+CO_FUTURE_ABSOLUTE_IMPORT = 0x4000
CO_FUTURE_WITH_STATEMENT = 0x8000
Modified: pypy/branch/2.5-features/pypy/interpreter/astcompiler/pycodegen.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/astcompiler/pycodegen.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/astcompiler/pycodegen.py Wed Aug 20 15:06:12 2008
@@ -10,7 +10,7 @@
SC_FREE, SC_CELL, SC_DEFAULT, OP_APPLY, OP_ASSIGN, OP_DELETE, OP_NONE
from pypy.interpreter.astcompiler.consts import CO_VARARGS, CO_VARKEYWORDS, \
CO_NEWLOCALS, CO_NESTED, CO_GENERATOR, CO_GENERATOR_ALLOWED, \
- CO_FUTURE_DIVISION, CO_FUTURE_WITH_STATEMENT, CO_FUTURE_ABSIMPORT
+ CO_FUTURE_DIVISION, CO_FUTURE_WITH_STATEMENT, CO_FUTURE_ABSOLUTE_IMPORT
from pypy.interpreter.pyparser.error import SyntaxError
from pypy.interpreter.astcompiler.opt import is_constant_false
from pypy.interpreter.astcompiler.opt import is_constant_true
@@ -151,7 +151,7 @@
elif feature == "with_statement":
self.graph.setFlag(CO_FUTURE_WITH_STATEMENT)
elif feature == "absolute_import":
- self.graph.setFlag(CO_FUTURE_ABSIMPORT)
+ self.graph.setFlag(CO_FUTURE_ABSOLUTE_IMPORT)
def emit(self, inst ):
return self.graph.emit( inst )
@@ -853,7 +853,7 @@
def visitImport(self, node):
self.set_lineno(node)
- if self.graph.checkFlag(CO_FUTURE_ABSIMPORT):
+ if self.graph.checkFlag(CO_FUTURE_ABSOLUTE_IMPORT):
level = 0
else:
level = -1
@@ -871,7 +871,7 @@
def visitFrom(self, node):
self.set_lineno(node)
level = node.level
- if level == 0 and not self.graph.checkFlag(CO_FUTURE_ABSIMPORT):
+ if level == 0 and not self.graph.checkFlag(CO_FUTURE_ABSOLUTE_IMPORT):
level = -1
fromlist = [ self.space.wrap(name) for name,alias in node.names ]
self.emitop_obj('LOAD_CONST', self.space.wrap(level)) # 2.5 flag
Modified: pypy/branch/2.5-features/pypy/interpreter/pyparser/future.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/pyparser/future.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/pyparser/future.py Wed Aug 20 15:06:12 2008
@@ -25,7 +25,7 @@
"""
from pypy.interpreter.astcompiler.consts import CO_GENERATOR_ALLOWED, \
- CO_FUTURE_DIVISION, CO_FUTURE_WITH_STATEMENT, CO_FUTURE_ABSIMPORT
+ CO_FUTURE_DIVISION, CO_FUTURE_WITH_STATEMENT, CO_FUTURE_ABSOLUTE_IMPORT
def getFutures(futureFlags, source):
futures = FutureAutomaton(futureFlags, source)
Modified: pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_futureautomaton.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_futureautomaton.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/pyparser/test/test_futureautomaton.py Wed Aug 20 15:06:12 2008
@@ -145,6 +145,6 @@
s = 'from __future__ import absolute_import\n'
f = run(s)
assert f.pos == len(s)
- assert f.flags == fut.CO_FUTURE_ABSIMPORT
+ assert f.flags == fut.CO_FUTURE_ABSOLUTE_IMPORT
More information about the Pypy-commit
mailing list