From d4e30357016f0b2e2a5093d810b7edea33501cd3 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Fri, 3 Mar 2006 20:21:48 +0000 Subject: Fix compiler breakage related to absolute imports --- Lib/compiler/pycodegen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py index 5fcdbb9..a1236de 100644 --- a/Lib/compiler/pycodegen.py +++ b/Lib/compiler/pycodegen.py @@ -891,7 +891,7 @@ class CodeGenerator: 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 @@ class CodeGenerator: 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: -- cgit v0.12