2.7 bug confusing "or" with "if" and "assert"

This commit is contained in:
rocky
2018-03-21 13:18:18 -04:00
parent cf5445c202
commit 0c3db340fa
2 changed files with 9 additions and 1 deletions

View File

@@ -538,7 +538,7 @@ class Python2Parser(PythonParser):
# if lhs == 'while1elsestmt':
# from trepan.api import debug; debug()
if lhs in ('aug_assign1', 'aug_assign2') and ast[0] and ast[0][0] == 'and':
if lhs in ('aug_assign1', 'aug_assign2') and ast[0] and ast[0][0] in ('and', 'or'):
return True
if rule == ('or', ('expr', 'jmp_true', 'expr', '\\e_come_from_opt')):
expr2 = ast[2]