Guard again improper assert transform...

we see this happen in getheader() from 3.0.1/lib/python3.0/http/client.pyc
This commit is contained in:
rocky
2019-11-15 22:19:17 -05:00
parent 4e9d8783d1
commit bc8907e752

View File

@@ -115,11 +115,14 @@ class TreeTransform(GenericASTTraversal, object):
call = expr[0]
LOAD_ASSERT = call[0]
expr = call[1][0]
node = SyntaxTree(
kind,
[assert_expr, jump_cond, LOAD_ASSERT, expr, RAISE_VARARGS_1]
)
if isinstance(call[1], SyntaxTree):
expr = call[1][0]
node = SyntaxTree(
kind,
[assert_expr, jump_cond, LOAD_ASSERT, expr, RAISE_VARARGS_1]
)
pass
pass
else:
# ifstmt
# 0. testexpr (2)