diff --git a/.cirrus.yml b/.cirrus.yml index 5b1098b06..1a2d278d7 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -151,7 +151,7 @@ task: folder: ~/.cache/pip fingerprint_script: echo Flake8 && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS install_script: - - pip install "flake8==7.0.0" "flake8-bugbear==24.1.16" + - pip install "flake8==7.2.0" "flake8-bugbear==24.12.12" # flake8-commas flake8_script: - flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum/_vendor/" env: diff --git a/electrum/commands.py b/electrum/commands.py index 77738c9fb..c2015d2dc 100644 --- a/electrum/commands.py +++ b/electrum/commands.py @@ -141,8 +141,6 @@ class Command: def command(s): def decorator(func): - global known_commands - if hasattr(func, '__wrapped__'): # plugin command function name = func.plugin_name + '_' + func.__name__ @@ -1913,7 +1911,6 @@ def plugin_command(s, plugin_name): """Decorator to register a cli command inside a plugin. To be used within a commands.py file in the plugins root.""" def decorator(func): - global known_commands assert len(plugin_name) > 0, "Plugin name must not be empty" func.plugin_name = plugin_name name = plugin_name + '_' + func.__name__ diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py index f51da149d..181363e49 100644 --- a/electrum/gui/qt/main_window.py +++ b/electrum/gui/qt/main_window.py @@ -2402,7 +2402,6 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger, QtEventListener): done = True def on_dialog_closed(*args): - nonlocal done nonlocal cancelled if not done: cancelled = True diff --git a/electrum/i18n.py b/electrum/i18n.py index 4d66d9614..1ccebc337 100644 --- a/electrum/i18n.py +++ b/electrum/i18n.py @@ -49,7 +49,6 @@ language = gettext.translation('electrum', fallback=True, class_=gettext.NullTra def _(msg: str, *, context=None) -> str: if msg == "": return "" # empty string must not be translated. see #7158 - global language if context: contexts = [context] if context[-1] != "|": # try with both "|" suffix and without diff --git a/electrum/plugin.py b/electrum/plugin.py index 508b1c6a2..c4d9996e6 100644 --- a/electrum/plugin.py +++ b/electrum/plugin.py @@ -186,7 +186,6 @@ class Plugins(DaemonThread): @profiler(min_threshold=0.5) def _has_recursive_root_permissions(self, path): """Check if a directory and all its subdirectories have root permissions""" - global _root_permission_cache if _root_permission_cache.get(path) is not None: return _root_permission_cache[path] _root_permission_cache[path] = False