Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 22, 2022
1 parent b674a57 commit 78014ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ldaptor/_scripts/ldap2dhcpconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def my_aton_numbits(num):
n = 0
while num > 0:
n >>= 1
n |= 2 ** 31
n |= 2**31
num -= 1
return n

Expand Down
4 changes: 2 additions & 2 deletions ldaptor/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def aton_numbits(num):
n = 0
while num > 0:
n >>= 1
n |= 2 ** 31
n |= 2**31
num -= 1
return n

Expand All @@ -35,7 +35,7 @@ def ntoa(n):

def netmaskToNumbits(netmask):
bits = aton(netmask)
i = 2 ** 31
i = 2**31
n = 0
while bits and i > 0:
if (bits & i) == 0:
Expand Down
4 changes: 2 additions & 2 deletions ldaptor/test/test_pureber.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BerLengths(unittest.TestCase):
(257, [0x80 | 2, 1, 1]),
(65535, [0x80 | 2, 0xFF, 0xFF]),
(65536, [0x80 | 3, 0x01, 0x00, 0x00]),
(256 ** 127 - 1, [0x80 | 127] + 127 * [0xFF]),
(256**127 - 1, [0x80 | 127] + 127 * [0xFF]),
)

def testToBER(self):
Expand All @@ -61,7 +61,7 @@ def testPartialBER(self):
pureber.BERExceptionInsufficientData, pureber.berDecodeLength, m[:1]
)

m = bytes(pureber.int2berlen(256 ** 100 - 1))
m = bytes(pureber.int2berlen(256**100 - 1))
self.assertEqual(101, len(m))
self.assertRaises(
pureber.BERExceptionInsufficientData, pureber.berDecodeLength, m[:100]
Expand Down

0 comments on commit 78014ff

Please sign in to comment.