From 7f3a536c9fbb8aa27977745b0484ff4badd798fd Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Wed, 16 Oct 2024 11:42:05 -0700 Subject: [PATCH] generation: Move list-iteration to end of short-circuited condition Suggested by Richard in code review. --- tools/generation/lib/template.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/generation/lib/template.py b/tools/generation/lib/template.py index 2e46ad5367..2a3b01f026 100644 --- a/tools/generation/lib/template.py +++ b/tools/generation/lib/template.py @@ -182,7 +182,9 @@ class Template: flags += case_values['meta'].get('flags', []) flags += self.attribs['meta'].get('flags', []) flags = without_duplicates(flags) - if 'async' in flags and negative and negative.get('phase') == 'parse' and negative.get('type') == 'SyntaxError': + if (negative and negative.get('phase') == 'parse' + and negative.get('type') == 'SyntaxError' + and 'async' in flags): flags.remove('async') lines += ['flags: ' + yaml.dump(flags, default_flow_style=True, width=float('inf')).strip()]