diff mercurial/httpconnection.py @ 15791:a814f8fcc65a

Use explicit integer division Found by running the test suite with the -3 flag to show places where we have int / int division that can be replaced with int // int.
author Martin Geisler <mg@aragost.com>
date Sun, 08 Jan 2012 18:15:54 +0100
parents b3083042bdda
children 72803c8edaa4
line wrap: on
line diff
--- a/mercurial/httpconnection.py	Sun Jan 08 17:57:25 2012 +0100
+++ b/mercurial/httpconnection.py	Sun Jan 08 18:15:54 2012 +0100
@@ -38,7 +38,7 @@
         self.write = self._data.write
         self.length = os.fstat(self._data.fileno()).st_size
         self._pos = 0
-        self._total = self.length / 1024 * 2
+        self._total = self.length // 1024 * 2
 
     def read(self, *args, **kwargs):
         try:
@@ -51,7 +51,7 @@
         # requires authentication. Since we can't know until we try
         # once whether authentication will be required, just lie to
         # the user and maybe the push succeeds suddenly at 50%.
-        self.ui.progress(_('sending'), self._pos / 1024,
+        self.ui.progress(_('sending'), self._pos // 1024,
                          unit=_('kb'), total=self._total)
         return ret