ci: bump flake8 to new version
```
./electrum/commands.py:144:9: F824 `global known_commands` is unused: name is never assigned in scope
global known_commands
^
./electrum/commands.py:1916:9: F824 `global known_commands` is unused: name is never assigned in scope
global known_commands
^
./electrum/gui/qt/main_window.py:2405:13: F824 `nonlocal done` is unused: name is never assigned in scope
nonlocal done
^
./electrum/i18n.py:52:5: F824 `global language` is unused: name is never assigned in scope
global language
^
./electrum/plugin.py:189:9: F824 `global _root_permission_cache` is unused: name is never assigned in scope
global _root_permission_cache
^
5 F824 `global known_commands` is unused: name is never assigned in scope
5
```
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user