Skip to content

Commit 055fba0

Browse files
committed
only actually works on python 3.9+
1 parent 55de5d4 commit 055fba0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/zeroconf/_services/info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
DNS_QUESTION_TYPE_QU = DNSQuestionType.QU
8787
DNS_QUESTION_TYPE_QM = DNSQuestionType.QM
8888

89-
IPADDRESS_SUPPORTS_SCOPE_ID = sys.version_info >= (3, 8, 0)
89+
IPADDRESS_SUPPORTS_SCOPE_ID = sys.version_info >= (3, 9, 0)
9090

9191
if TYPE_CHECKING:
9292
from .._core import Zeroconf

tests/services/test_info.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def test_multiple_addresses():
539539
assert info.addresses == [address, address]
540540
assert info.parsed_addresses() == [address_parsed, address_parsed]
541541
assert info.parsed_scoped_addresses() == [address_parsed, address_parsed]
542-
ipaddress_supports_scope_id = sys.version_info >= (3, 8, 0)
542+
ipaddress_supports_scope_id = sys.version_info >= (3, 9, 0)
543543

544544
if has_working_ipv6() and not os.environ.get('SKIP_IPV6'):
545545
address_v6_parsed = "2001:db8::1"
@@ -597,12 +597,12 @@ def test_multiple_addresses():
597597
assert info.parsed_scoped_addresses() == [
598598
address_parsed,
599599
address_v6_parsed,
600-
address_v6_ll_scoped_parsed,
600+
address_v6_ll_scoped_parsed if ipaddress_supports_scope_id else address_v6_ll_parsed,
601601
]
602602
assert info.parsed_scoped_addresses(r.IPVersion.V4Only) == [address_parsed]
603603
assert info.parsed_scoped_addresses(r.IPVersion.V6Only) == [
604604
address_v6_parsed,
605-
address_v6_ll_scoped_parsed,
605+
address_v6_ll_scoped_parsed if ipaddress_supports_scope_id else address_v6_ll_parsed,
606606
]
607607

608608

0 commit comments

Comments
 (0)