Skip to content

Commit 28067e2

Browse files
committed
Fix new flake8-comprehensions check C420
1 parent 883f852 commit 28067e2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

pycparserext/ext_c_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ def parse(self, text, filename='', debuglevel=0,
2323

2424
# _scope_stack[-1] is the current (topmost) scope.
2525

26-
initial_scope = {tpsym: 1 for tpsym in initial_type_symbols}
26+
initial_scope = dict.fromkeys(initial_type_symbols, 1)
2727
initial_scope.update(
28-
{tpsym: 1 for tpsym in self.initial_type_symbols})
28+
dict.fromkeys(self.initial_type_symbols, 1)
29+
)
2930
self._scope_stack = [initial_scope]
3031

3132
if not text or text.isspace():

0 commit comments

Comments
 (0)