You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Guard around null ast
This can happen in profiling
This commit is contained in:
@@ -398,7 +398,7 @@ class Python2Parser(PythonParser):
|
|||||||
|
|
||||||
def reduce_is_invalid(self, rule, ast, tokens, first, last):
|
def reduce_is_invalid(self, rule, ast, tokens, first, last):
|
||||||
lhs = rule[0]
|
lhs = rule[0]
|
||||||
if lhs in ('augassign1', 'augassign2') and ast[0][0] == 'and':
|
if lhs in ('augassign1', 'augassign2') and ast[0] and ast[0][0] == 'and':
|
||||||
return True
|
return True
|
||||||
elif lhs == '_stmts':
|
elif lhs == '_stmts':
|
||||||
for i, stmt in enumerate(ast):
|
for i, stmt in enumerate(ast):
|
||||||
|
Reference in New Issue
Block a user