File tree 3 files changed +5
-5
lines changed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 2
2
exclude_lines =
3
3
pragma: no cover
4
4
if TYPE_CHECKING:
5
+ if sys.version_info
Original file line number Diff line number Diff line change 97
97
"ZeroconfServiceTypes" ,
98
98
]
99
99
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
102
102
'''
103
103
Python version > 3.6 required for python-zeroconf.
104
104
If 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 20
20
USA
21
21
"""
22
22
23
+ import contextlib
23
24
import re
24
25
import socket
25
26
39
40
_MDNS_ADDR = '224.0.0.251'
40
41
_MDNS_ADDR_BYTES = socket .inet_aton (_MDNS_ADDR )
41
42
_MDNS_ADDR6 = 'ff02::fb'
42
- try :
43
+ with contextlib . suppress ( OSError ): # can't use AF_INET6, IPv6 is disabled
43
44
_MDNS_ADDR6_BYTES = socket .inet_pton (socket .AF_INET6 , _MDNS_ADDR6 )
44
- except OSError : # can't use AF_INET6, IPv6 is disabled
45
- pass
46
45
_MDNS_PORT = 5353
47
46
_DNS_PORT = 53
48
47
_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