Skip to content

Commit 493e4b1

Browse files
committed
Some Python 3.4 bugss fixed by using 3.5 rules
1 parent 9491c67 commit 493e4b1

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

uncompyle6/parsers/parse3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def p_grammar(self, args):
141141
142142
_ifstmts_jump ::= return_if_stmts
143143
_ifstmts_jump ::= c_stmts_opt JUMP_FORWARD COME_FROM
144+
_ifstmts_jump ::= c_stmts_opt COME_FROM
144145
145146
iflaststmt ::= testexpr c_stmts_opt JUMP_ABSOLUTE
146147

uncompyle6/parsers/parse35.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ def p_35on(self, args):
110110
111111
yield_from ::= expr GET_YIELD_FROM_ITER LOAD_CONST YIELD_FROM
112112
113-
_ifstmts_jump ::= c_stmts_opt COME_FROM
114113
"""
115114

116115
def add_custom_rules(self, tokens, customize):

uncompyle6/scanners/scanner3.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ def ingest(self, co, classname=None, code_objects={}, show_asm=None):
331331
(next_opname not in ('END_FINALLY', 'POP_BLOCK',
332332
# Python 3.0 only uses POP_TOP
333333
'POP_TOP'))):
334-
if (self.version >= 3.5 or
334+
if (self.version >= 3.4 or
335335
(inst.offset not in self.not_continue) or
336336
(tokens[-1].type == 'RETURN_VALUE')):
337337
opname = 'CONTINUE'
@@ -897,8 +897,6 @@ def detect_control_flow(self, offset, targets):
897897
# For now, we'll only tag forward jump.
898898
if rtarget > offset:
899899
self.fixed_jumps[offset] = rtarget
900-
self.not_continue.add(pre_rtarget)
901-
902900

903901
elif op == self.opc.SETUP_EXCEPT:
904902
target = self.get_target(offset)

0 commit comments

Comments
 (0)