X Tutup
Skip to content

Commit 7159115

Browse files
committed
3.0 .. 3.4 bug in whileTrue
1 parent 251de43 commit 7159115

File tree

6 files changed

+12
-0
lines changed

6 files changed

+12
-0
lines changed

test/bytecode_3.2/10_while.pyc

228 Bytes
Binary file not shown.

test/bytecode_3.4/10_while.pyc

174 Bytes
Binary file not shown.

test/bytecode_3.5/10_while.pyc

-170 Bytes
Binary file not shown.
336 Bytes
Binary file not shown.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
1+
# From 3.2 text_file.py
2+
def readline(self, line):
3+
while True:
4+
if self.join_lines:
5+
if line:
6+
continue
7+
if self:
8+
continue
9+
10+
return line
11+
112
while __name__ != '__main__':
213
b = 4

uncompyle6/parsers/parse3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ def p_stmt3(self, args):
286286
# Python < 3.5 no POP BLOCK
287287
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK _come_from
288288
whileTruestmt ::= SETUP_LOOP l_stmts_opt JUMP_BACK NOP _come_from
289+
whileTruestmt ::= SETUP_LOOP return_stmts _come_from
289290
while1stmt ::= SETUP_LOOP l_stmts _come_from JUMP_BACK _come_from
290291
"""
291292

0 commit comments

Comments
 (0)
X Tutup