Skip to content

Commit e357946

Browse files
committed
Loosen what is allowed in whilestmt38...
Fixes #498
1 parent 0627215 commit e357946

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

test/bytecode_3.8/03_while_bug.pyc

205 Bytes
Binary file not shown.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# See https://github.com/rocky/python-uncompyle6/issues/498
2+
# Bug was in not allowing _stmts in whilestmt38
3+
import time
4+
5+
r = 0
6+
while r == 1:
7+
print(time.time())
8+
if r == 1:
9+
r = 0

uncompyle6/semantics/customize38.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def customize_for_version38(self, version):
144144
"whilestmt38": (
145145
"%|while %c:\n%+%c%-\n\n",
146146
(1, ("bool_op", "testexpr", "testexprc")),
147-
(2, ("l_stmts", "l_stmts_opt", "pass")),
147+
(2, ("_stmts", "l_stmts", "l_stmts_opt", "pass")),
148148
),
149149
"whileTruestmt38": (
150150
"%|while True:\n%+%c%-\n\n",

0 commit comments

Comments
 (0)