diff --git a/pgp/backend/python_gnupg.py b/pgp/backend/python_gnupg.py index 64c4a2f..14c9696 100644 --- a/pgp/backend/python_gnupg.py +++ b/pgp/backend/python_gnupg.py @@ -73,7 +73,7 @@ class PGP(metaclass=Singleton): result = self._pgp.decrypt(data.encode("utf8")) return str(result) - @lru_cache(maxsize=8) + @lru_cache(maxsize=8) # noqa: B019 def sign(self, payload: str | None, key_id: str) -> str: if payload is None: payload = "" diff --git a/pgp/gtk/key.py b/pgp/gtk/key.py index 551e835..0758077 100644 --- a/pgp/gtk/key.py +++ b/pgp/gtk/key.py @@ -158,7 +158,7 @@ class ChooseGPGKeyDialog(GajimAppWindow): model = cast(Gtk.ListStore, self._ui.keys_treeview.get_model()) model.set_sort_func(1, self._sort) - for key_id in secret_keys.keys(): + for key_id in secret_keys: model.append((key_id, secret_keys[key_id])) self.set_child(self._ui.box) diff --git a/pgp/modules/events.py b/pgp/modules/events.py index e12d9cb..7d95aab 100644 --- a/pgp/modules/events.py +++ b/pgp/modules/events.py @@ -15,8 +15,8 @@ from __future__ import annotations from typing import Any -from typing import Callable +from collections.abc import Callable from dataclasses import dataclass from dataclasses import field diff --git a/pgp/modules/util.py b/pgp/modules/util.py index 334b39d..a876b0c 100644 --- a/pgp/modules/util.py +++ b/pgp/modules/util.py @@ -39,7 +39,7 @@ def find_gpg(): gpg_cmd = binary + " -h >nul 2>&1" else: gpg_cmd = binary + " -h >/dev/null 2>&1" - if subprocess.call(gpg_cmd, shell=True): + if subprocess.call(gpg_cmd, shell=True): # noqa: S602 return False return True