generation: Move list-iteration to end of short-circuited condition

Suggested by Richard in code review.
This commit is contained in:
Philip Chimento 2024-10-16 11:42:05 -07:00 committed by Philip Chimento
parent faca8af32d
commit 7f3a536c9f
1 changed files with 3 additions and 1 deletions

View File

@ -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()]