summaryrefslogtreecommitdiff
path: root/rebuilder.py
diff options
context:
space:
mode:
authorEmile Anclin <emile.anclin@logilab.fr>2010-03-22 15:19:53 +0100
committerEmile Anclin <emile.anclin@logilab.fr>2010-03-22 15:19:53 +0100
commitcf3d173db56f2081133a8a9d1670c9a6f2c8689c (patch)
tree0b8a9e3c4d78b71dfa48bdb2220322d1d52bb46f /rebuilder.py
parentec4ce3ab0dc8d3e48867ccdc3d928d2486d59599 (diff)
downloadastroid-git-cf3d173db56f2081133a8a9d1670c9a6f2c8689c.tar.gz
improve Module node initialisation
--HG-- branch : rebuild
Diffstat (limited to 'rebuilder.py')
-rw-r--r--rebuilder.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/rebuilder.py b/rebuilder.py
index 90b31b6b..4a44f482 100644
--- a/rebuilder.py
+++ b/rebuilder.py
@@ -44,14 +44,15 @@ class RebuildVisitor(object):
visit_method = getattr(self, visit_name)
return visit_method(node, parent)
- def build(self, node):
+ def build(self, node, modname, module_file):
"""rebuild the tree starting with an Module node;
return an astng.Module node
"""
self._metaclass = ['']
self._global_names = []
self._from_nodes = []
- module = self.visit_module(node, None)
+ module = self.visit_module(node, modname)
+ module.file = module.path = module_file
# init module cache here else we may get some infinite recursion
# errors while infering delayed assignments
if self._manager is not None: