Skip to content

Commit

Permalink
Small tweaks ...
Browse files Browse the repository at this point in the history
* Remove unneeded Makefile
* sync n_ifelsesmt transform with decompyle3
  • Loading branch information
rocky committed Apr 1, 2020
1 parent ceb26d2 commit 9caac7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
7 changes: 0 additions & 7 deletions uncompyle6/Makefile

This file was deleted.

9 changes: 6 additions & 3 deletions uncompyle6/semantics/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,11 @@ def n_ifelsestmt(self, node, preprocess=False):
old_stmts = None
else_suite_index = 1

if len(n) == 1 == len(n[0]) and n[0] == "stmt":
len_n = len(n)
if len_n == 1 == len(n[0]) and n[0] == "stmt":
n = n[0][0]
elif len_n == 0:
return node
elif n[0].kind in ("lastc_stmt", "lastl_stmt"):
n = n[0]
if n[0].kind in (
Expand All @@ -282,14 +285,14 @@ def n_ifelsestmt(self, node, preprocess=False):
pass
else:
if (
len(n) > 1
len_n > 1
and isinstance(n[0], SyntaxTree)
and 1 == len(n[0])
and n[0] == "stmt"
and n[1].kind == "stmt"
):
else_suite_stmts = n[0]
elif len(n) == 1:
elif len_n == 1:
else_suite_stmts = n
else:
return node
Expand Down

0 comments on commit 9caac7f

Please sign in to comment.