nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.53k stars 130 forks source link

core: prune return None from inserted Python blocks #458

Closed MatthieuDartiailh closed 2 years ago

MatthieuDartiailh commented 2 years ago

In Python <3.10+, we were sure to find a single implicit return None per python block. Starting with 3.10, the implicit return None in with or try/except can be duplicated rather than being behind a jump. So we identify all explicit return None in the AST and prune implicit return None from all blocks in the bytecode control flow graph.

codecov-commenter commented 2 years ago

Codecov Report

Merging #458 (2ce1347) into main (027e82e) will decrease coverage by 0.04%. The diff coverage is 91.66%.

@@            Coverage Diff             @@
##             main     #458      +/-   ##
==========================================
- Coverage   73.34%   73.30%   -0.05%     
==========================================
  Files         320      316       -4     
  Lines       24136    24104      -32     
  Branches       55       55              
==========================================
- Hits        17703    17669      -34     
- Misses       6433     6435       +2