From: Štěpán Balážik Date: Mon, 9 Feb 2026 14:45:58 +0000 (+0100) Subject: Remove the rest of Union usages by hand X-Git-Tag: v9.21.19~15^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdb74284318d38bf5b3bfd3424a01b042e1a31e0;p=thirdparty%2Fbind9.git Remove the rest of Union usages by hand These require some manual changes. --- diff --git a/bin/tests/system/isctest/log/watchlog.py b/bin/tests/system/isctest/log/watchlog.py index 24f298f118a..2bafdb193d3 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 9048e4630f8..1f48aeb1297 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 f4b90f2cf6d..2f004600f45 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,7 @@ lint.select = [ "RUF022", # unnecessary `typing` imports "UP006", + "UP007", # f-strings "UP031", "UP032",