From 8bf5fd96684eda9b4cf730dc4cc0a89f7db23d0a Mon Sep 17 00:00:00 2001 From: James Roy Date: Mon, 17 Feb 2025 13:07:26 +0800 Subject: [PATCH] style: edtlib: Remove the redundant call arguments Remove the redundant positional argument in open function to fix the Ruff UP015 warning. Signed-off-by: James Roy --- .ruff-excludes.toml | 1 - scripts/dts/python-devicetree/src/devicetree/edtlib.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index 32dc778c01b..99b0e985b32 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -444,7 +444,6 @@ "B904", # https://docs.astral.sh/ruff/rules/raise-without-from-inside-except "SIM118", # https://docs.astral.sh/ruff/rules/in-dict-keys "UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation - "UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes ] "./scripts/dts/python-devicetree/src/devicetree/grutils.py" = [ "E501", # https://docs.astral.sh/ruff/rules/line-too-long diff --git a/scripts/dts/python-devicetree/src/devicetree/edtlib.py b/scripts/dts/python-devicetree/src/devicetree/edtlib.py index ffb74fdccec..557bbfcae49 100644 --- a/scripts/dts/python-devicetree/src/devicetree/edtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/edtlib.py @@ -2457,7 +2457,7 @@ def load_vendor_prefixes_txt(vendor_prefixes: str) -> dict[str, str]: representation mapping a vendor prefix to the vendor name. """ vnd2vendor: dict[str, str] = {} - with open(vendor_prefixes, 'r', encoding='utf-8') as f: + with open(vendor_prefixes, encoding='utf-8') as f: for line in f: line = line.strip()