Loosen what is allowed in whilestmt38...

Fixes #498
This commit is contained in:
rocky 2024-07-13 11:54:22 -04:00
parent 0627215e98
commit e3579463ab
3 changed files with 10 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1,9 @@
# See https://github.com/rocky/python-uncompyle6/issues/498
# Bug was in not allowing _stmts in whilestmt38
import time
r = 0
while r == 1:
print(time.time())
if r == 1:
r = 0

View File

@ -144,7 +144,7 @@ def customize_for_version38(self, version):
"whilestmt38": (
"%|while %c:\n%+%c%-\n\n",
(1, ("bool_op", "testexpr", "testexprc")),
(2, ("l_stmts", "l_stmts_opt", "pass")),
(2, ("_stmts", "l_stmts", "l_stmts_opt", "pass")),
),
"whileTruestmt38": (
"%|while True:\n%+%c%-\n\n",