summaryrefslogtreecommitdiff
path: root/builder.py
diff options
context:
space:
mode:
authorTorsten Marek <shlomme@gmail.com>2014-04-25 23:43:47 +0200
committerTorsten Marek <shlomme@gmail.com>2014-04-25 23:43:47 +0200
commit0e131af59e62e3730f85699041a4785695bbe906 (patch)
treee8dcb9712819db1e5172b8c12acfdabd6926e59c /builder.py
parentfad5973bcd2adcb418f8f501c3d5a08f13409707 (diff)
downloadastroid-git-0e131af59e62e3730f85699041a4785695bbe906.tar.gz
Add future imports to Module.future_imports.
Diffstat (limited to 'builder.py')
-rw-r--r--builder.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/builder.py b/builder.py
index 0271f714..ef86ce62 100644
--- a/builder.py
+++ b/builder.py
@@ -148,6 +148,9 @@ class AstroidBuilder(InspectBuilder):
self._manager.astroid_cache[module.name] = module
# post tree building steps after we stored the module in the cache:
for from_node in module._from_nodes:
+ if from_node.modname == '__future__':
+ for symbol, _ in from_node.names:
+ module.future_imports.add(symbol)
self.add_from_names_to_locals(from_node)
# handle delayed assattr nodes
for delayed in module._delayed_assattr: