Skip to content

Commit 82c274e

Browse files
bpo-40334: Support suppressing of multiple optional variables in Pegen (GH-20367)
(cherry picked from commit cba5031) Co-authored-by: Batuhan Taskaya <[email protected]>
1 parent 1a4e9e6 commit 82c274e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tools/peg_generator/pegen/c_generator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ def visit_Alt(
694694
if v == "_cut_var":
695695
v += " = 0" # cut_var must be initialized
696696
self.print(f"{var_type}{v};")
697-
if v == "_opt_var":
698-
self.print("UNUSED(_opt_var); // Silence compiler warnings")
697+
if v.startswith("_opt_var"):
698+
self.print(f"UNUSED({v}); // Silence compiler warnings")
699699

700700
with self.local_variable_context():
701701
if is_loop:

0 commit comments

Comments
 (0)