gen_gcov_files.py: Replace bare 'except' with 'except Exception'
A bare 'except:' can do some annoying stuff like eat Ctrl-C (because it catches KeyboardInterrupt). Better to use 'except Exception:' as a catch-all. Even better might be to catch some more specific exception, because even 'except Exception:' eats stuff like misspelled identifiers. Fixes this pylint warning: scripts/gen_gcov_files.py:54:12: W0702: No exception type(s) specified (bare-except) Piggyback a formatting nit. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
4699375162
commit
16b548fcc7
1 changed files with 2 additions and 2 deletions
|
@ -48,10 +48,10 @@ def create_gcda_files(extracted_coverage_info):
|
|||
# if kobject_hash is given for coverage gcovr fails
|
||||
# hence skipping it problem only in gcovr v4.1
|
||||
if "kobject_hash" in filename:
|
||||
filename = (filename[:-4]) +"gcno"
|
||||
filename = filename[:-4] + "gcno"
|
||||
try:
|
||||
os.remove(filename)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
continue
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue