summaryrefslogtreecommitdiff
path: root/astroid/builder.py
diff options
context:
space:
mode:
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