You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Python 3 bugs ...
- Was using "while 1 .. else" improperly - docstring indent bug: was indenting docstring improperly
This commit is contained in:
@@ -338,10 +338,8 @@ class Python3Parser(PythonParser):
|
||||
whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK
|
||||
else_suite COME_FROM_LOOP
|
||||
|
||||
# FIXME: This gets confused with if/else in a loop. But while/else in Python
|
||||
# is probably pretty rare.
|
||||
while1elsestmt ::= SETUP_LOOP l_stmts JUMP_BACK
|
||||
else_suite COME_FROM_LOOP
|
||||
else_suite
|
||||
|
||||
whileelselaststmt ::= SETUP_LOOP testexpr l_stmts_opt JUMP_BACK POP_BLOCK
|
||||
else_suitec COME_FROM_LOOP
|
||||
|
@@ -26,8 +26,6 @@ class Python30Parser(Python3Parser):
|
||||
# Used to keep index order the same in semantic actions
|
||||
jb_pop_top ::= JUMP_BACK POP_TOP
|
||||
|
||||
# FIXME: Add COME_FROM designators
|
||||
# This gets confused with while1elsestmt. But this is probably more common
|
||||
while1stmt ::= SETUP_LOOP l_stmts COME_FROM_LOOP
|
||||
|
||||
else_suitel ::= l_stmts COME_FROM_LOOP JUMP_BACK
|
||||
|
@@ -542,7 +542,7 @@ def make_function3(self, node, isLambda, nested=1, codeNode=None):
|
||||
|
||||
if len(code.co_consts) > 0 and code.co_consts[0] is not None and not isLambda: # ugly
|
||||
# docstring exists, dump it
|
||||
self.print_docstring(indent, code.co_consts[0])
|
||||
self.print_docstring(self.indent, code.co_consts[0])
|
||||
|
||||
code._tokens = None # save memory
|
||||
assert ast == 'stmts'
|
||||
|
Reference in New Issue
Block a user