scripts: Remove unused variables in all Python scripts
Discovered with pylint3. Use the placeholder name '_' for unproblematic unused variables. It's what I'm used to, and pylint knows not to flag it. Python tip: for i in range(n): some_list.append(0) can be replaced with some_list += n*[0] Similarly, 3*'\t' gives '\t\t\t'. (Relevant here because pylint flagged the loop index as unused.) To do integer division in Python 3, use // instead of /. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
399c04ce5a
commit
12ba9dfa52
15 changed files with 19 additions and 26 deletions
|
@ -386,7 +386,7 @@ class ElfHelper:
|
|||
|
||||
# Step 1: collect all type information.
|
||||
for CU in di.iter_CUs():
|
||||
for idx, die in enumerate(CU.iter_DIEs()):
|
||||
for die in CU.iter_DIEs():
|
||||
# Unions are disregarded, kernel objects should never be union
|
||||
# members since the memory is not dedicated to that object and
|
||||
# could be something else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue