style: edtlib: Use the more readable not-equal operator

Replace 'not xx == xx' with 'xx != xx' to
fix the Ruff SIM201 warning.

Signed-off-by: James Roy <rruuaanng@outlook.com>
This commit is contained in:
James Roy 2025-02-17 13:15:25 +08:00 committed by Henrik Brix Andersen
parent b543c26548
commit 826ddaed97
2 changed files with 1 additions and 2 deletions

View File

@ -436,7 +436,6 @@
"UP035", # https://docs.astral.sh/ruff/rules/deprecated-import
]
"./scripts/dts/python-devicetree/src/devicetree/dtlib.py" = [
"SIM201", # https://docs.astral.sh/ruff/rules/negate-equal-op
"UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation
]
"./scripts/dts/python-devicetree/src/devicetree/edtlib.py" = [

View File

@ -110,7 +110,7 @@ class Node:
if name.count("@") > 1:
dt._parse_error("multiple '@' in node name")
if not name == "/":
if name != "/":
for char in name:
if char not in _nodename_chars:
dt._parse_error(f"{self.path}: bad character '{char}' "