localize 2 and 3 argument BUILD_SLICE...

Nontermninal name matches AST anme now. Add test.
This commit is contained in:
rocky
2017-11-25 21:07:43 -05:00
parent 3d7b160e30
commit b7003914c9
10 changed files with 53 additions and 17 deletions

View File

@@ -714,7 +714,7 @@ class SourceWalker(GenericASTTraversal, object):
assert False, "dunno about this python version"
self.prune() # stop recursing
def n_buildslice3(self, node):
def n_slice3(self, node):
p = self.prec
self.prec = 100
if not node[0].isNone():
@@ -728,7 +728,7 @@ class SourceWalker(GenericASTTraversal, object):
self.prec = p
self.prune() # stop recursing
def n_buildslice2(self, node):
def n_slice2(self, node):
p = self.prec
self.prec = 100
if not node[0].isNone():
@@ -1744,7 +1744,7 @@ class SourceWalker(GenericASTTraversal, object):
# if a tuple item is some sort of slice.
no_parens = False
for n in node:
if n == 'expr' and n[0].kind.startswith('buildslice'):
if n == 'expr' and n[0].kind.startswith('slice'):
no_parens = True
break
pass