mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-07 13:41:15 -07:00
Bump dnspython from 2.2.1 to 2.3.0 (#1975)
* Bump dnspython from 2.2.1 to 2.3.0 Bumps [dnspython](https://github.com/rthalley/dnspython) from 2.2.1 to 2.3.0. - [Release notes](https://github.com/rthalley/dnspython/releases) - [Changelog](https://github.com/rthalley/dnspython/blob/master/doc/whatsnew.rst) - [Commits](https://github.com/rthalley/dnspython/compare/v2.2.1...v2.3.0) --- updated-dependencies: - dependency-name: dnspython dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update dnspython==2.3.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
6910079330
commit
32c06a8b72
137 changed files with 7699 additions and 4277 deletions
|
@ -17,6 +17,8 @@
|
|||
|
||||
"""Generic Internet address helper functions."""
|
||||
|
||||
from typing import Any, Optional, Tuple
|
||||
|
||||
import socket
|
||||
|
||||
import dns.ipv4
|
||||
|
@ -30,7 +32,7 @@ AF_INET = socket.AF_INET
|
|||
AF_INET6 = socket.AF_INET6
|
||||
|
||||
|
||||
def inet_pton(family, text):
|
||||
def inet_pton(family: int, text: str) -> bytes:
|
||||
"""Convert the textual form of a network address into its binary form.
|
||||
|
||||
*family* is an ``int``, the address family.
|
||||
|
@ -51,7 +53,7 @@ def inet_pton(family, text):
|
|||
raise NotImplementedError
|
||||
|
||||
|
||||
def inet_ntop(family, address):
|
||||
def inet_ntop(family: int, address: bytes) -> str:
|
||||
"""Convert the binary form of a network address into its textual form.
|
||||
|
||||
*family* is an ``int``, the address family.
|
||||
|
@ -72,7 +74,7 @@ def inet_ntop(family, address):
|
|||
raise NotImplementedError
|
||||
|
||||
|
||||
def af_for_address(text):
|
||||
def af_for_address(text: str) -> int:
|
||||
"""Determine the address family of a textual-form network address.
|
||||
|
||||
*text*, a ``str``, the textual address.
|
||||
|
@ -94,7 +96,7 @@ def af_for_address(text):
|
|||
raise ValueError
|
||||
|
||||
|
||||
def is_multicast(text):
|
||||
def is_multicast(text: str) -> bool:
|
||||
"""Is the textual-form network address a multicast address?
|
||||
|
||||
*text*, a ``str``, the textual address.
|
||||
|
@ -116,7 +118,7 @@ def is_multicast(text):
|
|||
raise ValueError
|
||||
|
||||
|
||||
def is_address(text):
|
||||
def is_address(text: str) -> bool:
|
||||
"""Is the specified string an IPv4 or IPv6 address?
|
||||
|
||||
*text*, a ``str``, the textual address.
|
||||
|
@ -135,7 +137,9 @@ def is_address(text):
|
|||
return False
|
||||
|
||||
|
||||
def low_level_address_tuple(high_tuple, af=None):
|
||||
def low_level_address_tuple(
|
||||
high_tuple: Tuple[str, int], af: Optional[int] = None
|
||||
) -> Any:
|
||||
"""Given a "high-level" address tuple, i.e.
|
||||
an (address, port) return the appropriate "low-level" address tuple
|
||||
suitable for use in socket calls.
|
||||
|
@ -143,7 +147,6 @@ def low_level_address_tuple(high_tuple, af=None):
|
|||
If an *af* other than ``None`` is provided, it is assumed the
|
||||
address in the high-level tuple is valid and has that af. If af
|
||||
is ``None``, then af_for_address will be called.
|
||||
|
||||
"""
|
||||
address, port = high_tuple
|
||||
if af is None:
|
||||
|
@ -151,13 +154,13 @@ def low_level_address_tuple(high_tuple, af=None):
|
|||
if af == AF_INET:
|
||||
return (address, port)
|
||||
elif af == AF_INET6:
|
||||
i = address.find('%')
|
||||
i = address.find("%")
|
||||
if i < 0:
|
||||
# no scope, shortcut!
|
||||
return (address, port, 0, 0)
|
||||
# try to avoid getaddrinfo()
|
||||
addrpart = address[:i]
|
||||
scope = address[i + 1:]
|
||||
scope = address[i + 1 :]
|
||||
if scope.isdigit():
|
||||
return (addrpart, port, 0, int(scope))
|
||||
try:
|
||||
|
@ -167,4 +170,4 @@ def low_level_address_tuple(high_tuple, af=None):
|
|||
((*_, tup), *_) = socket.getaddrinfo(address, port, flags=ai_flags)
|
||||
return tup
|
||||
else:
|
||||
raise NotImplementedError(f'unknown address family {af}')
|
||||
raise NotImplementedError(f"unknown address family {af}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue