Patchwork [3,of,3,py3] tests: use int() instead of long() in test-pathencode.py

login
register
mail settings
Submitter Augie Fackler
Date Sept. 16, 2017, 5:29 p.m.
Message ID <824757c87fdb055a2673.1505582946@imladris.local>
Download mbox | patch
Permalink /patch/23952/
State Accepted
Headers show

Comments

Augie Fackler - Sept. 16, 2017, 5:29 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1505576885 14400
#      Sat Sep 16 11:48:05 2017 -0400
# Node ID 824757c87fdb055a267368da2cf556ca99534fdc
# Parent  bf018e7bcc466062c9dd0e845319d269c4e85acb
tests: use int() instead of long() in test-pathencode.py

Patch

diff --git a/tests/test-pathencode.py b/tests/test-pathencode.py
--- a/tests/test-pathencode.py
+++ b/tests/test-pathencode.py
@@ -188,7 +188,7 @@  def main():
         if o in ('-c', '--count'):
             count = int(a)
         elif o in ('-s', '--seed'):
-            seed = long(a, base=0) # accepts base 10 or 16 strings
+            seed = int(a, base=0) # accepts base 10 or 16 strings
         elif o == '--build':
             buildprobtable(sys.stdout,
                            'find .hg/store/data -type f && '
@@ -197,9 +197,9 @@  def main():
 
     if seed is None:
         try:
-            seed = long(binascii.hexlify(os.urandom(16)), 16)
+            seed = int(binascii.hexlify(os.urandom(16)), 16)
         except AttributeError:
-            seed = long(time.time() * 1000)
+            seed = int(time.time() * 1000)
 
     rng = random.Random(seed)
     if runtests(rng, seed, count):