File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22exclude_lines =
33 pragma: no cover
44 if TYPE_CHECKING:
5+ if sys.version_info
Original file line number Diff line number Diff line change 9797 "ZeroconfServiceTypes" ,
9898]
9999
100- if sys .version_info <= (3 , 6 ):
101- raise ImportError (
100+ if sys .version_info <= (3 , 6 ): # pragma: no cover
101+ raise ImportError ( # pragma: no cover
102102 '''
103103Python version > 3.6 required for python-zeroconf.
104104If you need support for Python 2 or Python 3.3-3.4 please use version 19.1
Original file line number Diff line number Diff line change 2020 USA
2121"""
2222
23+ import contextlib
2324import re
2425import socket
2526
3940_MDNS_ADDR = '224.0.0.251'
4041_MDNS_ADDR_BYTES = socket .inet_aton (_MDNS_ADDR )
4142_MDNS_ADDR6 = 'ff02::fb'
42- try :
43+ with contextlib . suppress ( OSError ): # can't use AF_INET6, IPv6 is disabled
4344 _MDNS_ADDR6_BYTES = socket .inet_pton (socket .AF_INET6 , _MDNS_ADDR6 )
44- except OSError : # can't use AF_INET6, IPv6 is disabled
45- pass
4645_MDNS_PORT = 5353
4746_DNS_PORT = 53
4847_DNS_HOST_TTL = 120 # two minute for host records (A, SRV etc) as-per RFC6762
You can’t perform that action at this time.
0 commit comments