Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
exclude_lines =
pragma: no cover
if TYPE_CHECKING:
if sys.version_info
4 changes: 2 additions & 2 deletions zeroconf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
"ZeroconfServiceTypes",
]

if sys.version_info <= (3, 6):
raise ImportError(
if sys.version_info <= (3, 6): # pragma: no cover
raise ImportError( # pragma: no cover
'''
Python version > 3.6 required for python-zeroconf.
If you need support for Python 2 or Python 3.3-3.4 please use version 19.1
Expand Down
5 changes: 2 additions & 3 deletions zeroconf/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
USA
"""

import contextlib
import re
import socket

Expand All @@ -39,10 +40,8 @@
_MDNS_ADDR = '224.0.0.251'
_MDNS_ADDR_BYTES = socket.inet_aton(_MDNS_ADDR)
_MDNS_ADDR6 = 'ff02::fb'
try:
with contextlib.suppress(OSError): # can't use AF_INET6, IPv6 is disabled
_MDNS_ADDR6_BYTES = socket.inet_pton(socket.AF_INET6, _MDNS_ADDR6)
except OSError: # can't use AF_INET6, IPv6 is disabled
pass
_MDNS_PORT = 5353
_DNS_PORT = 53
_DNS_HOST_TTL = 120 # two minute for host records (A, SRV etc) as-per RFC6762
Expand Down