From: Štěpán Balážik Date: Tue, 10 Feb 2026 15:12:57 +0000 (+0100) Subject: Replace deprecated typing imports X-Git-Tag: v9.21.19~15^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ced002c4ab7b920c9528d315a611a477cb4a9409;p=thirdparty%2Fbind9.git Replace deprecated typing imports More specific modules (like collections.abc) can now be used. Generated with: ruff check --extend-select UP035 --fix --- diff --git a/bin/tests/system/bailiwick/ans1/ans.py b/bin/tests/system/bailiwick/ans1/ans.py index 7606236fdaa..75bf8790b24 100644 --- a/bin/tests/system/bailiwick/ans1/ans.py +++ b/bin/tests/system/bailiwick/ans1/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rdatatype import dns.rrset diff --git a/bin/tests/system/bailiwick/ans2/ans.py b/bin/tests/system/bailiwick/ans2/ans.py index 18781673570..a1010cc5d6d 100644 --- a/bin/tests/system/bailiwick/ans2/ans.py +++ b/bin/tests/system/bailiwick/ans2/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rdatatype import dns.rrset diff --git a/bin/tests/system/chain/ans3/ans.py b/bin/tests/system/chain/ans3/ans.py index f10387fbf44..a36ab41c70b 100755 --- a/bin/tests/system/chain/ans3/ans.py +++ b/bin/tests/system/chain/ans3/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.name import dns.rcode diff --git a/bin/tests/system/chain/ans4/ans.py b/bin/tests/system/chain/ans4/ans.py index 3e1aeea7435..b21ba81fefc 100755 --- a/bin/tests/system/chain/ans4/ans.py +++ b/bin/tests/system/chain/ans4/ans.py @@ -11,9 +11,9 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ +from collections.abc import AsyncGenerator from dataclasses import dataclass from enum import Enum -from typing import AsyncGenerator import abc import logging diff --git a/bin/tests/system/cookie/cookie_ans.py b/bin/tests/system/cookie/cookie_ans.py index 84d3f7011c7..3b6f0406f2a 100644 --- a/bin/tests/system/cookie/cookie_ans.py +++ b/bin/tests/system/cookie/cookie_ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.edns import dns.name diff --git a/bin/tests/system/digdelv/ans5/ans.py b/bin/tests/system/digdelv/ans5/ans.py index e13f9522791..1d7375791e9 100644 --- a/bin/tests/system/digdelv/ans5/ans.py +++ b/bin/tests/system/digdelv/ans5/ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import logging diff --git a/bin/tests/system/digdelv/ans6/ans.py b/bin/tests/system/digdelv/ans6/ans.py index e723d96c16e..78b9ce70407 100644 --- a/bin/tests/system/digdelv/ans6/ans.py +++ b/bin/tests/system/digdelv/ans6/ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.opcode import dns.rcode diff --git a/bin/tests/system/digdelv/ans7/ans.py b/bin/tests/system/digdelv/ans7/ans.py index 0dde43c6a80..a9a8a0966c3 100644 --- a/bin/tests/system/digdelv/ans7/ans.py +++ b/bin/tests/system/digdelv/ans7/ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode diff --git a/bin/tests/system/dispatch/ans3/ans.py b/bin/tests/system/dispatch/ans3/ans.py index 97b1f2cf1fb..1099928b08a 100644 --- a/bin/tests/system/dispatch/ans3/ans.py +++ b/bin/tests/system/dispatch/ans3/ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.flags import dns.rcode diff --git a/bin/tests/system/dnssec/ans10/ans.py b/bin/tests/system/dnssec/ans10/ans.py index d5d22e621e2..b584151f0d6 100644 --- a/bin/tests/system/dnssec/ans10/ans.py +++ b/bin/tests/system/dnssec/ans10/ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rdatatype import dns.rrset diff --git a/bin/tests/system/fetchlimit/ans4/ans.py b/bin/tests/system/fetchlimit/ans4/ans.py index cd7602366b6..3b01eaa6a6a 100644 --- a/bin/tests/system/fetchlimit/ans4/ans.py +++ b/bin/tests/system/fetchlimit/ans4/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode import dns.rdatatype diff --git a/bin/tests/system/forward/ans11/ans.py b/bin/tests/system/forward/ans11/ans.py index b5b590aabf4..9c854a6b76b 100644 --- a/bin/tests/system/forward/ans11/ans.py +++ b/bin/tests/system/forward/ans11/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rdatatype import dns.rrset diff --git a/bin/tests/system/forward/ans6/ans.py b/bin/tests/system/forward/ans6/ans.py index fdcbe7d392d..271439b37c7 100644 --- a/bin/tests/system/forward/ans6/ans.py +++ b/bin/tests/system/forward/ans6/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.name import dns.rcode diff --git a/bin/tests/system/isctest/asyncserver.py b/bin/tests/system/isctest/asyncserver.py index 453751629f0..080c08c3806 100644 --- a/bin/tests/system/isctest/asyncserver.py +++ b/bin/tests/system/isctest/asyncserver.py @@ -11,8 +11,9 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ +from collections.abc import AsyncGenerator, Callable, Coroutine, Sequence from dataclasses import dataclass, field -from typing import Any, AsyncGenerator, Callable, Coroutine, Sequence, cast +from typing import Any, cast import abc import asyncio diff --git a/bin/tests/system/isctest/log/watchlog.py b/bin/tests/system/isctest/log/watchlog.py index f1fc0ec8fa9..22f81b94fa8 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, Pattern, TextIO, TypeAlias, TypeVar +from re import Match, Pattern +from typing import Any, TextIO, TypeAlias, TypeVar import abc import os diff --git a/bin/tests/system/isctest/name.py b/bin/tests/system/isctest/name.py index e0b23805ac0..02b43059a77 100644 --- a/bin/tests/system/isctest/name.py +++ b/bin/tests/system/isctest/name.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import Iterable +from collections.abc import Iterable from dns.name import Name diff --git a/bin/tests/system/isctest/query.py b/bin/tests/system/isctest/query.py index 7c767be167d..57af8254c90 100644 --- a/bin/tests/system/isctest/query.py +++ b/bin/tests/system/isctest/query.py @@ -9,7 +9,8 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import Any, Callable +from collections.abc import Callable +from typing import Any import os import time diff --git a/bin/tests/system/isctest/text.py b/bin/tests/system/isctest/text.py index d305aee7759..a60c1bbae3a 100644 --- a/bin/tests/system/isctest/text.py +++ b/bin/tests/system/isctest/text.py @@ -11,8 +11,10 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. +from collections.abc import Iterator +from re import Match, Pattern from re import compile as Re -from typing import Iterator, Match, Pattern, TextIO +from typing import TextIO import abc import re diff --git a/bin/tests/system/ixfr/ans2/ans.py b/bin/tests/system/ixfr/ans2/ans.py index 37b22917216..5c9268a193f 100644 --- a/bin/tests/system/ixfr/ans2/ans.py +++ b/bin/tests/system/ixfr/ans2/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator, Collection, Iterable +from collections.abc import AsyncGenerator, Collection, Iterable import abc diff --git a/bin/tests/system/nsec3-answer/tests_nsec3.py b/bin/tests/system/nsec3-answer/tests_nsec3.py index bed0aadc280..f339813cedc 100755 --- a/bin/tests/system/nsec3-answer/tests_nsec3.py +++ b/bin/tests/system/nsec3-answer/tests_nsec3.py @@ -15,9 +15,9 @@ # https://github.com/pylint-dev/pylint/issues/10785#issuecomment-3677224217 # pylint: disable=unreachable +from collections.abc import Container, Iterable from dataclasses import dataclass from pathlib import Path -from typing import Container, Iterable import os diff --git a/bin/tests/system/qmin/ans2/ans.py b/bin/tests/system/qmin/ans2/ans.py index 5d35903da83..a8e7d7cd97b 100644 --- a/bin/tests/system/qmin/ans2/ans.py +++ b/bin/tests/system/qmin/ans2/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.name import dns.rcode diff --git a/bin/tests/system/qmin/ans4/ans.py b/bin/tests/system/qmin/ans4/ans.py index 08286a4bba1..c3c55472581 100644 --- a/bin/tests/system/qmin/ans4/ans.py +++ b/bin/tests/system/qmin/ans4/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode import dns.rdatatype diff --git a/bin/tests/system/qmin/qmin_ans.py b/bin/tests/system/qmin/qmin_ans.py index 6185e15a109..74c4891b6e0 100644 --- a/bin/tests/system/qmin/qmin_ans.py +++ b/bin/tests/system/qmin/qmin_ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import abc diff --git a/bin/tests/system/resolver/ans10/ans.py b/bin/tests/system/resolver/ans10/ans.py index e2810e9252e..0abb52c54c2 100644 --- a/bin/tests/system/resolver/ans10/ans.py +++ b/bin/tests/system/resolver/ans10/ans.py @@ -9,7 +9,7 @@ # See the COPYRIGHT file distributed with this work for additional # information regarding copyright ownership. -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode import dns.rdatatype diff --git a/bin/tests/system/resolver/ans2/ans.py b/bin/tests/system/resolver/ans2/ans.py index 88413d14e9b..9d27310527d 100644 --- a/bin/tests/system/resolver/ans2/ans.py +++ b/bin/tests/system/resolver/ans2/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.edns import dns.name diff --git a/bin/tests/system/resolver/ans3/ans.py b/bin/tests/system/resolver/ans3/ans.py index 36172f76851..8913186a702 100644 --- a/bin/tests/system/resolver/ans3/ans.py +++ b/bin/tests/system/resolver/ans3/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.name import dns.rcode diff --git a/bin/tests/system/resolver/ans8/ans.py b/bin/tests/system/resolver/ans8/ans.py index 6ef65f21571..98929085bcb 100644 --- a/bin/tests/system/resolver/ans8/ans.py +++ b/bin/tests/system/resolver/ans8/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import abc diff --git a/bin/tests/system/resolver/resolver_ans.py b/bin/tests/system/resolver/resolver_ans.py index 285cf44b975..e2bf2dc30b2 100644 --- a/bin/tests/system/resolver/resolver_ans.py +++ b/bin/tests/system/resolver/resolver_ans.py @@ -11,7 +11,8 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator, NamedTuple +from collections.abc import AsyncGenerator +from typing import NamedTuple import abc diff --git a/bin/tests/system/rpzrecurse/ans5/ans.py b/bin/tests/system/rpzrecurse/ans5/ans.py index 6eed86d7f45..576f9d0f06e 100644 --- a/bin/tests/system/rpzrecurse/ans5/ans.py +++ b/bin/tests/system/rpzrecurse/ans5/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode import dns.rdatatype diff --git a/bin/tests/system/statistics/ans4/ans.py b/bin/tests/system/statistics/ans4/ans.py index 52e0a00d50e..dd16e4c4712 100644 --- a/bin/tests/system/statistics/ans4/ans.py +++ b/bin/tests/system/statistics/ans4/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode import dns.rdatatype diff --git a/bin/tests/system/tsig/ans2/ans.py b/bin/tests/system/tsig/ans2/ans.py index 677a57cf8f8..fe91046d510 100644 --- a/bin/tests/system/tsig/ans2/ans.py +++ b/bin/tests/system/tsig/ans2/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.flags diff --git a/bin/tests/system/xfer/ans9/ans.py b/bin/tests/system/xfer/ans9/ans.py index 269afafe228..25da6b7d43d 100644 --- a/bin/tests/system/xfer/ans9/ans.py +++ b/bin/tests/system/xfer/ans9/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import dns.rcode import dns.rdatatype diff --git a/bin/tests/system/zero/ans5/ans.py b/bin/tests/system/zero/ans5/ans.py index ad4a4e3ffda..5ff475d801a 100644 --- a/bin/tests/system/zero/ans5/ans.py +++ b/bin/tests/system/zero/ans5/ans.py @@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional information regarding copyright ownership. """ -from typing import AsyncGenerator +from collections.abc import AsyncGenerator import ipaddress diff --git a/pyproject.toml b/pyproject.toml index 916b886cdaf..308c1275685 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -101,6 +101,7 @@ lint.select = [ # unnecessary `typing` imports "UP006", "UP007", + "UP035", "UP045", # f-strings "UP031",