mirror of
https://github.com/syssec-utd/pylingual.git
synced 2026-05-11 10:50:12 -07:00
Merge pull request #63 from drospierski24/cflow-refactor
Adjust TryFinally so TryFinallyReturn test case works
This commit is contained in:
@@ -758,9 +758,7 @@ class TryFinally3_6(ControlFlowTemplate):
|
||||
return None
|
||||
mapping["try_header"] = mapping.pop("try_except")
|
||||
|
||||
cutoff = next((i for i, x in enumerate(mapping["fail_body"].get_instructions()) if x.opname == "END_FINALLY"), None)
|
||||
if cutoff is None:
|
||||
return None
|
||||
cutoff = next((i for i, x in enumerate(mapping["fail_body"].get_instructions()) if x.opname == "END_FINALLY"), 0)
|
||||
|
||||
template = condense_mapping(cls, cfg, mapping, "try_header", "try_body", "finally_body", "fail_body")
|
||||
template.cutoff = cutoff
|
||||
|
||||
Reference in New Issue
Block a user