Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Python 3.8 && 3.9 try-except-finally logic #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 24, 2024

  1. Implement Python 3.8 && 3.9 try-except-finally logic

    - Add tests for simple cases of try-except-finally;
    
    - Implement `JUMP_IF_NOT_EXC_MATCH_A` with a fake `CMP_EXCEPTION`
      followed by a `POP_JUMP_IF_TRUE`;
    
    - Implement `BEGIN_FINALLY` with a fake `LOAD_CONST_A None`;
    
    - Implement Python 3.8+ specific `SETUP_FINALLY_A` handling both
      EXCEPT and FINALLY cases. We guess which is which by looking
      at the targetted block that seems to either be a POP_TOP or a
      DUP_TOP in the case of an EXCEPT block;
    
    - Implement RERAISE with a fake END_FINALLY;
    
    - In Python 3.9+, skip the duplicated code from the FINALLY blocks
      with a jump in bytecode and a fake `END_FINALLY`.
    Levak committed Jun 24, 2024
    Configuration menu
    Copy the full SHA
    9ba2484 View commit details
    Browse the repository at this point in the history