1
0
forked from VimPlug/jedi

Don't assume every module has a namespace

This commit is contained in:
Laurens Van Houtven
2013-06-23 21:59:58 +02:00
parent adec666994
commit e82e3eaa0d
2 changed files with 13 additions and 0 deletions

View File

@@ -333,6 +333,9 @@ def _enables_absolute_import(imp):
Checks if the import is a ``__future__`` import that enables the
``absolute_import`` feature.
"""
if imp.namespace is None:
return False
namespace, feature = imp.from_ns.names[0], imp.namespace.names[0]
return namespace == "__future__" and feature == "absolute_import"