You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Handle if elif else case for 3.5
This commit is contained in:
@@ -674,7 +674,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
n = n[0][0]
|
||||
elif n[0].kind in ('lastc_stmt', 'lastl_stmt'):
|
||||
n = n[0]
|
||||
if n[0].kind in ('ifstmt', 'iflaststmt', 'iflaststmtl', 'ifelsestmtl'):
|
||||
if n[0].kind in ('ifstmt', 'iflaststmt', 'iflaststmtl', 'ifelsestmtl', 'ifelsestmtc'):
|
||||
# This seems needed for Python 2.5-2.7
|
||||
n = n[0]
|
||||
pass
|
||||
@@ -682,7 +682,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
elif ( len(n) > 1 and 1 == len(n[0]) and n[0] == 'stmt'
|
||||
and n[1].kind == "stmt" ):
|
||||
else_suite_stmts = n[0]
|
||||
if else_suite_stmts.kind not in ('ifstmt', 'iflaststmt', 'ifelsestmtl'):
|
||||
if else_suite_stmts[0].kind not in ('ifstmt', 'iflaststmt', 'ifelsestmtl'):
|
||||
if not preprocess:
|
||||
self.default(node)
|
||||
return
|
||||
|
Reference in New Issue
Block a user