Exclude early versions of Python in last change

This commit is contained in:
rocky
2018-03-01 00:00:23 -05:00
parent e23315b2e6
commit 257c3ca454

View File

@@ -1293,10 +1293,11 @@ 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)
if isinstance(node[1].pattr, tuple):
node[1].pattr = '.'.join(node[1].pattr)
if self.version >= 2.5:
if node[relative_path_index].attr > 0:
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