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:
dependabot[bot] 2023-03-02 20:54:32 -08:00 committed by GitHub
parent 6910079330
commit 32c06a8b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
137 changed files with 7699 additions and 4277 deletions

View file

@ -2,13 +2,14 @@
"""Serial Number Arthimetic from RFC 1982"""
class Serial:
def __init__(self, value, bits=32):
self.value = value % 2 ** bits
def __init__(self, value: int, bits: int = 32):
self.value = value % 2**bits
self.bits = bits
def __repr__(self):
return f'dns.serial.Serial({self.value}, {self.bits})'
return f"dns.serial.Serial({self.value}, {self.bits})"
def __eq__(self, other):
if isinstance(other, int):
@ -29,11 +30,11 @@ class Serial:
other = Serial(other, self.bits)
elif not isinstance(other, Serial) or other.bits != self.bits:
return NotImplemented
if self.value < other.value and \
other.value - self.value < 2 ** (self.bits - 1):
if self.value < other.value and other.value - self.value < 2 ** (self.bits - 1):
return True
elif self.value > other.value and \
self.value - other.value > 2 ** (self.bits - 1):
elif self.value > other.value and self.value - other.value > 2 ** (
self.bits - 1
):
return True
else:
return False
@ -46,11 +47,11 @@ class Serial:
other = Serial(other, self.bits)
elif not isinstance(other, Serial) or other.bits != self.bits:
return NotImplemented
if self.value < other.value and \
other.value - self.value > 2 ** (self.bits - 1):
if self.value < other.value and other.value - self.value > 2 ** (self.bits - 1):
return True
elif self.value > other.value and \
self.value - other.value < 2 ** (self.bits - 1):
elif self.value > other.value and self.value - other.value < 2 ** (
self.bits - 1
):
return True
else:
return False
@ -69,7 +70,7 @@ class Serial:
if abs(delta) > (2 ** (self.bits - 1) - 1):
raise ValueError
v += delta
v = v % 2 ** self.bits
v = v % 2**self.bits
return Serial(v, self.bits)
def __iadd__(self, other):
@ -83,7 +84,7 @@ class Serial:
if abs(delta) > (2 ** (self.bits - 1) - 1):
raise ValueError
v += delta
v = v % 2 ** self.bits
v = v % 2**self.bits
self.value = v
return self
@ -98,7 +99,7 @@ class Serial:
if abs(delta) > (2 ** (self.bits - 1) - 1):
raise ValueError
v -= delta
v = v % 2 ** self.bits
v = v % 2**self.bits
return Serial(v, self.bits)
def __isub__(self, other):
@ -112,6 +113,6 @@ class Serial:
if abs(delta) > (2 ** (self.bits - 1) - 1):
raise ValueError
v -= delta
v = v % 2 ** self.bits
v = v % 2**self.bits
self.value = v
return self