File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,18 +51,18 @@ def on_service_state_change(
5151 parser .add_argument ('--debug' , action = 'store_true' )
5252 parser .add_argument ('--find' , action = 'store_true' , help = 'Browse all available services' )
5353 version_group = parser .add_mutually_exclusive_group ()
54- version_group .add_argument ('--v6' , action = 'store_true' )
5554 version_group .add_argument ('--v6-only' , action = 'store_true' )
55+ version_group .add_argument ('--v4-only' , action = 'store_true' )
5656 args = parser .parse_args ()
5757
5858 if args .debug :
5959 logging .getLogger ('zeroconf' ).setLevel (logging .DEBUG )
60- if args .v6 :
61- ip_version = IPVersion .All
62- elif args .v6_only :
60+ if args .v6_only :
6361 ip_version = IPVersion .V6Only
64- else :
62+ elif args . v4_only :
6563 ip_version = IPVersion .V4Only
64+ else :
65+ ip_version = IPVersion .All
6666
6767 zeroconf = Zeroconf (ip_version = ip_version )
6868
Original file line number Diff line number Diff line change 8686DNS_QUESTION_TYPE_QU = DNSQuestionType .QU
8787DNS_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
9191if TYPE_CHECKING :
9292 from .._core import Zeroconf
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments