Skip to content

Commit a81ffe8

Browse files
committed
Python 3 bugs ...
- Was using "while 1 .. else" improperly - docstring indent bug: was indenting docstring improperly
1 parent 3b9e48a commit a81ffe8

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

uncompyle6/parsers/parse3.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -338,10 +338,8 @@ def p_loop_stmt3(self, args):
338338
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK
339339
else_suite COME_FROM_LOOP
340340
341-
# FIXME: This gets confused with if/else in a loop. But while/else in Python
342-
# is probably pretty rare.
343341
while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK
344-
else_suite COME_FROM_LOOP
342+
else_suite
345343
346344
whileelselaststmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK
347345
else_suitec COME_FROM_LOOP

uncompyle6/parsers/parse30.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ def p_30(self, args):
2626
# Used to keep index order the same in semantic actions
2727
jb_pop_top ::= JUMP_BACK POP_TOP
2828
29-
# FIXME: Add COME_FROM designators
30-
# This gets confused with while1elsestmt. But this is probably more common
3129
while1stmt ::= SETUP_LOOP l_stmts COME_FROM_LOOP
3230
3331
else_suitel ::= l_stmts COME_FROM_LOOP JUMP_BACK

uncompyle6/semantics/make_function.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def build_param(ast, name, default):
542542

543543
if len(code.co_consts) > 0 and code.co_consts[0] is not None and not isLambda: # ugly
544544
# docstring exists, dump it
545-
self.print_docstring(indent, code.co_consts[0])
545+
self.print_docstring(self.indent, code.co_consts[0])
546546

547547
code._tokens = None # save memory
548548
assert ast == 'stmts'

0 commit comments

Comments
 (0)