diff --git a/.github/workflows/python-code-quality.yml b/.github/workflows/python-code-quality.yml index 538f76ee918..59f723e1e7e 100644 --- a/.github/workflows/python-code-quality.yml +++ b/.github/workflows/python-code-quality.yml @@ -36,7 +36,7 @@ jobs: # renovate: datasource=pypi depName=bandit BANDIT_VERSION: "1.8.0" # renovate: datasource=pypi depName=ruff - RUFF_VERSION: "0.8.2" + RUFF_VERSION: "0.8.3" runs-on: ${{ matrix.os }} permissions: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c094d2bbd05..2138c36642f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: ) - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.8.2 + rev: v0.8.3 hooks: # Run the linter. - id: ruff diff --git a/gui/wxpython/core/utils.py b/gui/wxpython/core/utils.py index b04d2e73c12..e500c47d263 100644 --- a/gui/wxpython/core/utils.py +++ b/gui/wxpython/core/utils.py @@ -849,8 +849,7 @@ def StoreEnvVariable(key, value=None, envFile=None): # update environmental variables if value is None: - if key in environ: - del environ[key] + environ.pop(key, None) else: environ[key] = value diff --git a/python/grass/pydispatch/signal.py b/python/grass/pydispatch/signal.py index 51808e01ee3..12e73e71882 100644 --- a/python/grass/pydispatch/signal.py +++ b/python/grass/pydispatch/signal.py @@ -266,8 +266,7 @@ def __call__(self, *args, **kwargs): Traceback (most recent call last): TypeError: mywrite() takes exactly 1 argument (0 given) """ - if "signal" in kwargs: - del kwargs["signal"] + kwargs.pop("signal", None) self.emit(*args, **kwargs)