move is_nested check from evaluate.imports to the parser
This commit is contained in:
1 parent
04855e9452
commit
13949ec145
2 files changed
+12
-14
No files matched your search
@@ -776,6 +776,16 @@ class Import(Simple):
|
||||
n.append(self.alias)
|
||||
return n
|
||||
|
||||
def is_nested(self):
|
||||
"""
|
||||
This checks for the special case of nested imports, without aliases and
|
||||
from statement::
|
||||
|
||||
import foo.bar
|
||||
"""
|
||||
return not self.alias and not self.from_ns \
|
||||
and len(self.namespace.names) > 1 \
|
||||
|
||||
|
||||
class KeywordStatement(Base):
|
||||
"""
|
||||
|
||||
Reference in new issue
Block a user