File tree Expand file tree Collapse file tree 1 file changed +20
-22
lines changed
scripts/west_commands/runners Expand file tree Collapse file tree 1 file changed +20
-22
lines changed Original file line number Diff line number Diff line change @@ -149,28 +149,26 @@ def _parse(self, filename: str):
149149 not_set = re .compile ('^# (?P<option>CONFIG_[A-Za-z0-9_]+) is not set$' )
150150
151151 with open (filename , 'r' ) as f :
152- lines = f .readlines ()
153-
154- for line in lines :
155- match = opt_value .match (line )
156- if match :
157- value = match .group ('value' ).rstrip ()
158- if value .startswith ('"' ) and value .endswith ('"' ):
159- value = value [1 :- 1 ]
160- else :
161- try :
162- base = 16 if value .startswith ('0x' ) else 10
163- self .options [match .group ('option' )] = int (value , base = base )
164- continue
165- except ValueError :
166- pass
167-
168- self .options [match .group ('option' )] = value
169- continue
170-
171- match = not_set .match (line )
172- if match :
173- self .options [match .group ('option' )] = 'n'
152+ for line in f :
153+ match = opt_value .match (line )
154+ if match :
155+ value = match .group ('value' ).rstrip ()
156+ if value .startswith ('"' ) and value .endswith ('"' ):
157+ value = value [1 :- 1 ]
158+ else :
159+ try :
160+ base = 16 if value .startswith ('0x' ) else 10
161+ self .options [match .group ('option' )] = int (value , base = base )
162+ continue
163+ except ValueError :
164+ pass
165+
166+ self .options [match .group ('option' )] = value
167+ continue
168+
169+ match = not_set .match (line )
170+ if match :
171+ self .options [match .group ('option' )] = 'n'
174172
175173class MissingProgram (FileNotFoundError ):
176174 '''FileNotFoundError subclass for missing program dependencies.
You can’t perform that action at this time.
0 commit comments