[elbe-devel] [PATCH 13/40] pylint: don't iterate over dict keys
Torben Hohn
torben.hohn at linutronix.de
Thu Sep 20 11:32:39 CEST 2018
On Fri, Sep 14, 2018 at 01:56:25PM +0200, Manuel Traut wrote:
> Signed-off-by: Manuel Traut <manut at linutronix.de>
uhh... maybe that was the cause why it did not
work with disable=not-an-iterable ?
can you fix that ?
the E1133 changes belong into the previous patch.
the .keys() removal is good.
> ---
> elbepack/commands/pkgdiff.py | 8 ++++----
> elbepack/virtapt.py | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/elbepack/commands/pkgdiff.py b/elbepack/commands/pkgdiff.py
> index 59387302..aa769550 100644
> --- a/elbepack/commands/pkgdiff.py
> +++ b/elbepack/commands/pkgdiff.py
> @@ -56,8 +56,8 @@ def run_command(argv):
> gc = apt.Cache()
>
> gen_pkgs = {}
> + # pylint: disable=E1133
> for p in gen_cache.packages:
> - # pylint: disable=E1133
> if opt.noauto:
> if p.current_ver and not \
> gc[p.name].is_auto_installed and not \
> @@ -75,8 +75,8 @@ def run_command(argv):
> fc = apt.Cache()
>
> fix_pkgs = {}
> + # pylint: disable=E1133
> for p in fix_cache.packages:
> - # pylint: disable=E1133
> if opt.noauto:
> if p.current_ver and not \
> fc[p.name].is_auto_installed and not \
> @@ -90,11 +90,11 @@ def run_command(argv):
> if p not in gen_pkgs:
> print("+<pkg>%s</pkg>" % p)
>
> - for p in gen_pkgs.keys():
> + for p in gen_pkgs:
> if p not in fix_pkgs.keys():
> print("-<pkg>%s</pkg>" % p)
>
> - for p in fix_pkgs.keys():
> + for p in fix_pkgs:
> if p in gen_pkgs.keys() and fix_pkgs[p] != gen_pkgs[p]:
> print(
> "%s: Version mismatch %s != %s" %
> diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
> index 7bff22c6..62090115 100644
> --- a/elbepack/virtapt.py
> +++ b/elbepack/virtapt.py
> @@ -249,8 +249,8 @@ class VirtApt(object):
> pkg = None
> c = None
> if not c:
> + # pylint: disable=E1133
> for p in self.cache.packages:
> - # pylint: disable=E1133
> for x in p.provides_list:
> if pp == x[0]:
> pkg = self.cache[x[2].parent_pkg.name]
> --
> 2.19.0.rc2
>
--
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99
Hinweise zum Datenschutz finden Sie hier (Informations on data privacy
can be found here): https://linutronix.de/kontakt/Datenschutz.php
Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen |
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180920/d9106118/attachment.sig>
More information about the elbe-devel
mailing list