Remove the rest of Union usages by hand

These require some manual changes.
This commit is contained in:
Štěpán Balážik 2026-02-09 15:45:58 +01:00
parent ce9c9a1a9c
commit cdb7428431
3 changed files with 6 additions and 4 deletions

View 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):

View file

@ -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:

View file

@ -98,6 +98,7 @@ lint.select = [
"RUF022",
# unnecessary `typing` imports
"UP006",
"UP007",
# f-strings
"UP031",
"UP032",