diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2018-03-30 10:42:16 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2018-03-30 10:43:33 +0200 |
commit | 7f46f9341cc54bbe6763409c4ca7ea3adfec098a (patch) | |
tree | 55b39e14fc8693bb7211d5c28298596676738258 /astroid/rebuilder.py | |
parent | 75b6c1a333baffa70e29a42d43650aa7bc331b4d (diff) | |
download | astroid-git-7f46f9341cc54bbe6763409c4ca7ea3adfec098a.tar.gz |
Module.__path__ is now a list
It used to be a string containing the path, but it doesn't reflect the situation
on Python, where it is actually a list.
Also fix a bug with namespace package's __path__ attribute, which wasn't using the
module's __path__, but its file attribute, which is None for namespace packages.
Close #528
Diffstat (limited to 'astroid/rebuilder.py')
-rw-r--r-- | astroid/rebuilder.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/astroid/rebuilder.py b/astroid/rebuilder.py index a323e972..5d4ffcff 100644 --- a/astroid/rebuilder.py +++ b/astroid/rebuilder.py @@ -125,7 +125,8 @@ class TreeRebuilder(object): def visit_module(self, node, modname, modpath, package): """visit a Module node by returning a fresh instance of it""" node, doc = _get_doc(node) - newnode = nodes.Module(name=modname, doc=doc, file=modpath, path=modpath, + newnode = nodes.Module(name=modname, doc=doc, file=modpath, + path=[modpath], package=package, parent=None) newnode.postinit([self.visit(child, newnode) for child in node.body]) return newnode |