comparison tests/seq.py @ 49285:56f98406831b

py3: remove xrange() compatibility code Some code used its own xrange() compatibility code instead of pycompat.xrange().
author Manuel Jacob <me@manueljacob.de>
date Sun, 29 May 2022 15:32:43 +0200
parents 6000f5b25c9b
children
comparison
equal deleted inserted replaced
49284:d44e3c45f0e4 49285:56f98406831b
17 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) 17 msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
18 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) 18 msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
19 except ImportError: 19 except ImportError:
20 pass 20 pass
21 21
22 if sys.version_info[0] >= 3:
23 xrange = range
24
25 start = 1 22 start = 1
26 if len(sys.argv) > 2: 23 if len(sys.argv) > 2:
27 start = int(sys.argv[1]) 24 start = int(sys.argv[1])
28 25
29 step = 1 26 step = 1
30 if len(sys.argv) > 3: 27 if len(sys.argv) > 3:
31 step = int(sys.argv[2]) 28 step = int(sys.argv[2])
32 29
33 stop = int(sys.argv[-1]) + 1 30 stop = int(sys.argv[-1]) + 1
34 31
35 for i in xrange(start, stop, step): 32 for i in range(start, stop, step):
36 print(i) 33 print(i)