Don't assume either namespace is not-None
This commit is contained in:
1 parent
7eff1bbf06
commit
58b165e4b6
2 files changed
+2
-2
No files matched your search
@@ -333,7 +333,7 @@ def _enables_absolute_import(imp):
|
||||
Checks if the import is a ``__future__`` import that enables the
|
||||
``absolute_import`` feature.
|
||||
"""
|
||||
if imp.namespace is None:
|
||||
if imp.from_ns is None or imp.namespace is None:
|
||||
return False
|
||||
|
||||
namespace, feature = imp.from_ns.names[0], imp.namespace.names[0]
|
||||
|
||||
Reference in new issue
Block a user