Skip to content

Commit 3eb7be9

Browse files
authored
Cleanup coverage data (python-zeroconf#858)
1 parent 59247f1 commit 3eb7be9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
exclude_lines =
33
pragma: no cover
44
if TYPE_CHECKING:
5+
if sys.version_info

zeroconf/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@
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
'''
103103
Python version > 3.6 required for python-zeroconf.
104104
If you need support for Python 2 or Python 3.3-3.4 please use version 19.1

zeroconf/const.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
USA
2121
"""
2222

23+
import contextlib
2324
import re
2425
import socket
2526

@@ -39,10 +40,8 @@
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

0 commit comments

Comments
 (0)