3.8 SETUP_EXCEPT removal workaround; reinstate option -c | --compile

This commit is contained in:
rocky
2019-04-11 07:19:35 -04:00
parent cfe7feed4d
commit 7f65a8a6dd
3 changed files with 49 additions and 34 deletions

View File

@@ -916,7 +916,7 @@ class Scanner3(Scanner):
# Python 3.5 may remove as dead code a JUMP
# instruction after a RETURN_VALUE. So we check
# based on seeing SETUP_EXCEPT various places.
if code[rtarget] == self.opc.SETUP_EXCEPT:
if self.version < 3.8 and code[rtarget] == self.opc.SETUP_EXCEPT:
return
# Check that next instruction after pops and jump is
# not from SETUP_EXCEPT
@@ -928,7 +928,7 @@ class Scanner3(Scanner):
if next_op in targets:
for try_op in targets[next_op]:
come_from_op = code[try_op]
if come_from_op == self.opc.SETUP_EXCEPT:
if self.version < 3.8 and come_from_op == self.opc.SETUP_EXCEPT:
return
pass
pass