diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index 311caeda1939..95a4d3961c59 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -437,7 +437,6 @@ ] "./scripts/dts/python-devicetree/src/devicetree/dtlib.py" = [ "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports - "UP007", # https://docs.astral.sh/ruff/rules/non-pep604-annotation "UP035", # https://docs.astral.sh/ruff/rules/deprecated-import "UP037", # https://docs.astral.sh/ruff/rules/quoted-annotation ] diff --git a/scripts/dts/python-devicetree/src/devicetree/dtlib.py b/scripts/dts/python-devicetree/src/devicetree/dtlib.py index 948dfd3c8b30..1ff3e5e68c74 100644 --- a/scripts/dts/python-devicetree/src/devicetree/dtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/dtlib.py @@ -20,9 +20,8 @@ import string import sys import textwrap -from typing import (Any, Iterable, - NamedTuple, NoReturn, Optional, - TYPE_CHECKING, Union) +from typing import (Any, Iterable, NamedTuple, + NoReturn, Optional, TYPE_CHECKING) # NOTE: tests/test_dtlib.py is the test suite for this library. @@ -674,7 +673,7 @@ class _FileStackElt(NamedTuple): contents: str pos: int -_TokVal = Union[int, str] +_TokVal = int | str class _Token(NamedTuple): id: int