aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2022-09-28 12:48:11 +0545
committerMike Frysinger <vapier@gentoo.org>2022-09-28 13:27:17 +0545
commitbbb4e5d73ee1f3df12a1cd467beca3a476c5f054 (patch)
tree0ca0c16a0ae958526d5f0a59043a99f131e92643
parentlddtree: simplify join logic (diff)
downloadpax-utils-bbb4e5d73ee1f3df12a1cd467beca3a476c5f054.tar.gz
pax-utils-bbb4e5d73ee1f3df12a1cd467beca3a476c5f054.tar.bz2
pax-utils-bbb4e5d73ee1f3df12a1cd467beca3a476c5f054.zip
lddtree: avoid shadowing function args
pylint warns about redefining |lib| here, and it's right -- the code is a little hard to follow because of it. So give it a diff name. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xlddtree.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/lddtree.py b/lddtree.py
index 85dd91f..d894505 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -589,17 +589,17 @@ def _ActionShow(options: argparse.Namespace, elf: dict):
print(f"{indent}{lib}", "=>", fullpath)
new_libs = []
- for lib in elf['libs'][lib]['needed']:
- if lib in chain_libs:
+ for nlib in elf["libs"][lib]["needed"]:
+ if nlib in chain_libs:
if not options.list:
- print(f"{indent}{lib} => !!! circular loop !!!")
+ print(f"{indent}{nlib} => !!! circular loop !!!")
continue
- if options.all or not lib in shown_libs:
- shown_libs.add(lib)
- new_libs.append(lib)
+ if options.all or not nlib in shown_libs:
+ shown_libs.add(nlib)
+ new_libs.append(nlib)
- for lib in new_libs:
- _show(lib, depth + 1)
+ for nlib in new_libs:
+ _show(nlib, depth + 1)
chain_libs.pop()
shown_libs = set(elf['needed'])