]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove the rest of Union usages by hand
authorŠtěpán Balážik <stepan@isc.org>
Mon, 9 Feb 2026 14:45:58 +0000 (15:45 +0100)
committerŠtěpán Balážik <stepan@isc.org>
Fri, 20 Feb 2026 14:17:32 +0000 (15:17 +0100)
These require some manual changes.

bin/tests/system/isctest/log/watchlog.py
bin/tests/system/isctest/text.py
pyproject.toml

index 24f298f118ae3e733e793db96b8b922ee52c3ff9..2bafdb193d33561512bd169c5fc14290464a9638 100644 (file)
@@ -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):
index 9048e4630f824374e7e2a5ea031af537591ce15f..1f48aeb1297ea9d208716677f6fe9de2d56017ad 100644 (file)
 # 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:
index f4b90f2cf6d14d5eec7d2a94418211f83abf351e..2f004600f456f384ce3b7d236b171225bf4948e3 100644 (file)
@@ -98,6 +98,7 @@ lint.select = [
   "RUF022",
   # unnecessary `typing` imports
   "UP006",
+  "UP007",
   # f-strings
   "UP031",
   "UP032",