changeset 42531:f3fa10a5877d

py3: use integer division for the value passed to xrange Differential Revision: https://phab.mercurial-scm.org/D6576
author Rodrigo Damazio Bovendorp <rdamazio@google.com>
date Tue, 25 Jun 2019 19:30:24 -0700
parents 49998d5ba66a
children 9913fffd744b
files mercurial/pure/osutil.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pure/osutil.py	Tue Jun 25 19:28:41 2019 -0700
+++ b/mercurial/pure/osutil.py	Tue Jun 25 19:30:24 2019 -0700
@@ -5,7 +5,7 @@
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2 or any later version.
 
-from __future__ import absolute_import
+from __future__ import absolute_import, division
 
 import ctypes
 import ctypes.util
@@ -149,7 +149,7 @@
             cmsg.cmsg_type != _SCM_RIGHTS):
             return []
         rfds = ctypes.cast(cmsg.cmsg_data, ctypes.POINTER(ctypes.c_int))
-        rfdscount = ((cmsg.cmsg_len - _cmsghdr.cmsg_data.offset) /
+        rfdscount = ((cmsg.cmsg_len - _cmsghdr.cmsg_data.offset) //
                      ctypes.sizeof(ctypes.c_int))
         return [rfds[i] for i in pycompat.xrange(rfdscount)]