This commit is contained in:
rocky
2016-12-24 07:45:02 -05:00
parent 7d58dcf6dd
commit e3f4beeb74
11 changed files with 21 additions and 26 deletions

View File

@@ -492,7 +492,6 @@ class SourceWalker(GenericASTTraversal, object):
self.write("\n" + self.indent + INDENT_PER_LEVEL[:-1])
return self.line_number
def customize_for_version(self, is_pypy, version):
if is_pypy:
########################
@@ -537,7 +536,6 @@ class SourceWalker(GenericASTTraversal, object):
'raise_stmt2': ( '%|raise %c from %c\n', 0, 1),
})
if version < 2.0:
TABLE_DIRECT.update({
'importlist': ( '%C', (0, maxint, ', ') ),
@@ -622,7 +620,6 @@ class SourceWalker(GenericASTTraversal, object):
self.prune() # stop recursing
self.n_mkfunc_annotate = n_mkfunc_annotate
if version >= 3.4:
########################
# Python 3.4+ Additions
@@ -1149,7 +1146,6 @@ class SourceWalker(GenericASTTraversal, object):
assert n == 'lc_body'
self.write( '[ ')
if self.version >= 2.7:
expr = n[0]
list_iter = node[-1]
@@ -1337,7 +1333,7 @@ class SourceWalker(GenericASTTraversal, object):
n = ast[iter_index]
assert n == 'list_iter', n
## FIXME: I'm not totally sure this is right.
# FIXME: I'm not totally sure this is right.
# find innermost node
if_node = None
@@ -2139,7 +2135,6 @@ class SourceWalker(GenericASTTraversal, object):
self.println()
del ast[i]
# the function defining a class normally returns locals(); we
# don't want this to show up in the source, thus remove the node
if len(ast) > 0 and ast[-1][0] == RETURN_LOCALS: