[Python-checkins] r42815 - python/trunk/Lib/compiler/pycodegen.py
neal.norwitz
python-checkins at python.org
Fri Mar 3 21:21:49 CET 2006
Author: neal.norwitz
Date: Fri Mar 3 21:21:48 2006
New Revision: 42815
Modified:
python/trunk/Lib/compiler/pycodegen.py
Log:
Fix compiler breakage related to absolute imports
Modified: python/trunk/Lib/compiler/pycodegen.py
==============================================================================
--- python/trunk/Lib/compiler/pycodegen.py (original)
+++ python/trunk/Lib/compiler/pycodegen.py Fri Mar 3 21:21:48 2006
@@ -891,7 +891,7 @@
def visitImport(self, node):
self.set_lineno(node)
- level = 0 if "absolute_import" in self.futures else -1
+ level = 0 if self.graph.checkFlag(CO_FUTURE_ABSIMPORT) else -1
for name, alias in node.names:
if VERSION > 1:
self.emit('LOAD_CONST', level)
@@ -907,7 +907,7 @@
def visitFrom(self, node):
self.set_lineno(node)
level = node.level
- if level == 0 and "absolute_import" not in self.futures:
+ if level == 0 and not self.graph.checkFlag(CO_FUTURE_ABSIMPORT):
level = -1
fromlist = map(lambda (name, alias): name, node.names)
if VERSION > 1:
More information about the Python-checkins
mailing list