Fix bug in 2.6- except_cond3

This commit is contained in:
rocky
2017-12-03 06:16:29 -05:00
parent cfce914889
commit 260bfd176e
3 changed files with 16 additions and 7 deletions

View File

@@ -353,6 +353,7 @@ class SourceWalker(GenericASTTraversal, object):
'testtrue_then': ( 'not %p', (0, 22) ),
})
if 2.4 <= version <= 2.6:
TABLE_DIRECT.update({
'comp_for': ( ' for %c in %c', 3, 1 ),
@@ -1901,6 +1902,10 @@ class SourceWalker(GenericASTTraversal, object):
node[-2][0].kind = 'unpack_w_parens'
self.default(node)
# except_cond3 is only in Python <= 2.6
n_except_cond3 = n_except_cond2
def template_engine(self, entry, startnode):
"""The format template interpetation engine. See the comment at the
beginning of this module for the how we interpret format