diff --git a/bin/tests/system/isctest/log/watchlog.py b/bin/tests/system/isctest/log/watchlog.py index 24f298f118..2bafdb193d 100644 --- a/bin/tests/system/isctest/log/watchlog.py +++ b/bin/tests/system/isctest/log/watchlog.py @@ -9,7 +9,8 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import Any, Match, Optional, Pattern, TextIO, TypeVar, Union + +from typing import Any, Match, Optional, Pattern, TextIO, TypeAlias, TypeVar import abc import os @@ -18,7 +19,7 @@ import time from isctest.text import FlexPattern, LineReader, compile_pattern T = TypeVar("T") -OneOrMore = Union[T, list[T]] +OneOrMore: TypeAlias = T | list[T] class WatchLogException(Exception): diff --git a/bin/tests/system/isctest/text.py b/bin/tests/system/isctest/text.py index 9048e4630f..1f48aeb129 100644 --- a/bin/tests/system/isctest/text.py +++ b/bin/tests/system/isctest/text.py @@ -12,12 +12,12 @@ # information regarding copyright ownership. from re import compile as Re -from typing import Iterator, Match, Optional, Pattern, TextIO, Union +from typing import Iterator, Match, Optional, Pattern, TextIO import abc import re -FlexPattern = Union[str, Pattern] +FlexPattern = str | Pattern def compile_pattern(string: FlexPattern) -> Pattern: diff --git a/pyproject.toml b/pyproject.toml index f4b90f2cf6..2f004600f4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,7 @@ lint.select = [ "RUF022", # unnecessary `typing` imports "UP006", + "UP007", # f-strings "UP031", "UP032",