editing header to adjust for <3.12 versions

This commit is contained in:
Xinlong Hu
2025-12-15 14:20:41 -06:00
parent 8090d4cbf0
commit f4cd3eadc0
3 changed files with 4 additions and 4 deletions
@@ -66,7 +66,7 @@ class RemoveUnreachable(ControlFlowTemplate):
return node
@register_template(0, 0, (3, 12), (3, 13))
@register_template(0, 0, *versions_from(3, 12))
class JumpTemplate(ControlFlowTemplate):
template = T(
body=~N("jump", None).with_cond(without_instructions("CLEANUP_THROW")),
@@ -1,5 +1,5 @@
from ..cft import ControlFlowTemplate, EdgeKind, MetaTemplate, register_template
from ..utils import E, T, N, defer_source_to, has_some_lines, run_is, has_no_lines, with_instructions, exact_instructions, has_instval, starting_instructions, to_indented_source, make_try_match, without_top_level_instructions, ending_instructions
from ..utils import E, T, N, defer_source_to, has_some_lines, run_is, has_no_lines, versions_from, with_instructions, exact_instructions, has_instval, starting_instructions, to_indented_source, make_try_match, without_top_level_instructions, ending_instructions
from .Loop import BreakTemplate, ContinueTemplate
class EarlyRet(ControlFlowTemplate):
@@ -80,7 +80,7 @@ class IfElseJump(ControlFlowTemplate):
"""
@register_template(1, 39, (3, 12), (3, 13))
@register_template(1, 39, *versions_from(3, 12))
class IfElseLoop(ControlFlowTemplate):
template = T(
if_header=~N("else_body", "if_body").with_cond(without_top_level_instructions("WITH_EXCEPT_START", "CHECK_EXC_MATCH", "FOR_ITER")),
@@ -181,7 +181,7 @@ class WhileElse3_10(ControlFlowTemplate):
"""
@register_template(0, 1, (3, 12), (3, 13))
@register_template(0, 1, *versions_from(3, 12))
class WhileElse3_12(ControlFlowTemplate):
template = T(
while_header=~N("while_body", "else_body"),