comparison mercurial/pure/osutil.py @ 38783:e7aa113b14f7

global: use pycompat.xrange() On Python 3, our module importer automatically rewrites xrange() to pycompat.xrange(). We want to move away from the custom importer on Python 3. This commit converts all instances of xrange() to use pycompat.xrange(). Differential Revision: https://phab.mercurial-scm.org/D4032
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 01 Aug 2018 13:00:45 -0700
parents 75979c8d4572
children 3b421154d2ca
comparison
equal deleted inserted replaced
38782:7eba8f83129b 38783:e7aa113b14f7
148 cmsg.cmsg_type != _SCM_RIGHTS): 148 cmsg.cmsg_type != _SCM_RIGHTS):
149 return [] 149 return []
150 rfds = ctypes.cast(cmsg.cmsg_data, ctypes.POINTER(ctypes.c_int)) 150 rfds = ctypes.cast(cmsg.cmsg_data, ctypes.POINTER(ctypes.c_int))
151 rfdscount = ((cmsg.cmsg_len - _cmsghdr.cmsg_data.offset) / 151 rfdscount = ((cmsg.cmsg_len - _cmsghdr.cmsg_data.offset) /
152 ctypes.sizeof(ctypes.c_int)) 152 ctypes.sizeof(ctypes.c_int))
153 return [rfds[i] for i in xrange(rfdscount)] 153 return [rfds[i] for i in pycompat.xrange(rfdscount)]
154 154
155 else: 155 else:
156 import msvcrt 156 import msvcrt
157 157
158 _kernel32 = ctypes.windll.kernel32 158 _kernel32 = ctypes.windll.kernel32