commit: bbb4e5d73ee1f3df12a1cd467beca3a476c5f054 Author: Mike Frysinger <vapier <AT> chromium <DOT> org> AuthorDate: Wed Sep 28 07:03:11 2022 +0000 Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> CommitDate: Wed Sep 28 07:42:17 2022 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=bbb4e5d7
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 <AT> gentoo.org> lddtree.py | 16 ++++++++-------- 1 file 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'])