diff --git a/ldaptor/_scripts/ldap2dhcpconf.py b/ldaptor/_scripts/ldap2dhcpconf.py index a589e02c..992e8d2e 100644 --- a/ldaptor/_scripts/ldap2dhcpconf.py +++ b/ldaptor/_scripts/ldap2dhcpconf.py @@ -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 diff --git a/ldaptor/dns.py b/ldaptor/dns.py index 0005e93e..710b3824 100644 --- a/ldaptor/dns.py +++ b/ldaptor/dns.py @@ -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 @@ -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: diff --git a/ldaptor/test/test_pureber.py b/ldaptor/test/test_pureber.py index ea4633c9..5c8ccd25 100644 --- a/ldaptor/test/test_pureber.py +++ b/ldaptor/test/test_pureber.py @@ -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): @@ -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]