summaryrefslogtreecommitdiff
path: root/astroid/builder.py
diff options
context:
space:
mode:
authorƁukasz Rogalski <rogalski.91@gmail.com>2017-04-02 13:55:27 +0200
committerGitHub <noreply@github.com>2017-04-02 13:55:27 +0200
commit92665fe273b9e5899fa28ef7f67d4794db42478f (patch)
treec76590e46df64f29b29203a5039524abd50f6fc6 /astroid/builder.py
parent31f21cd2a45be5f8e7d198fb8605b9122051f8e5 (diff)
downloadastroid-git-92665fe273b9e5899fa28ef7f67d4794db42478f.tar.gz
Builder: fix detection of whether file is a package when there is a __init__.py in filename (#408)
Fixes PyCQA/pylint#1348
Diffstat (limited to 'astroid/builder.py')
-rw-r--r--astroid/builder.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/astroid/builder.py b/astroid/builder.py
index ee3b7e25..afb9daf1 100644
--- a/astroid/builder.py
+++ b/astroid/builder.py
@@ -192,7 +192,7 @@ class AstroidBuilder(raw_building.InspectBuilder):
modname = modname[:-9]
package = True
else:
- package = path.find('__init__.py') > -1 if path else False
+ package = path is not None and os.path.splitext(os.path.basename(path))[0] == '__init__'
builder = rebuilder.TreeRebuilder(self._manager)
module = builder.visit_module(node, modname, node_file, package)
module._import_from_nodes = builder._import_from_nodes