Fallout from more precise token attributes

This commit is contained in:
rocky
2018-02-28 23:35:52 -05:00
parent 413df51dfa
commit e23315b2e6
8 changed files with 39 additions and 8 deletions

View File

@@ -1294,7 +1294,9 @@ class SourceWalker(GenericASTTraversal, object):
def n_import_from(self, node):
relative_path_index = 0
if self.version >= 2.5 and node[relative_path_index].attr > 0:
node[2].pattr = '.'*node[relative_path_index].pattr + node[2].attr
node[2].pattr = '.' * (node[relative_path_index].pattr + node[2].attr)
if isinstance(node[1].pattr, tuple):
node[1].pattr = '.'.join(node[1].pattr)
self.default(node)
n_import_from_star = n_import_from