Kaydet (Commit) 558fc977 authored tarafından Guido van Rossum's avatar Guido van Rossum

Don't use hex constants representing negative numbers.

üst dc15c27f
...@@ -249,7 +249,7 @@ class GeneralModuleTests(unittest.TestCase): ...@@ -249,7 +249,7 @@ class GeneralModuleTests(unittest.TestCase):
def testNtoH(self): def testNtoH(self):
for func in socket.htonl, socket.ntohl: for func in socket.htonl, socket.ntohl:
for i in (0, 1, 0xffff0000, 2L): for i in (0, 1, ~0xffff, 2L):
self.assertEqual(i, func(func(i))) self.assertEqual(i, func(func(i)))
biglong = 2**32L - 1 biglong = 2**32L - 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment