py3: use integer division in curseschunkselector.printstring()
authorDenis Laxalde <denis.laxalde@logilab.fr>
Thu, 10 Oct 2019 12:22:15 +0200
changeset 43159 b02387005515
parent 43158 ff615b6b5b8f
child 43160 84a950007619
py3: use integer division in curseschunkselector.printstring() This fixes a crash when scrolling in curses UI when refresh() is called when a float value (namely 'self.firstlineofpadtoprint', taking its value indirectly from 'self.linesprintedtopadsofar').
mercurial/crecord.py
--- a/mercurial/crecord.py	Thu Oct 10 12:20:23 2019 +0200
+++ b/mercurial/crecord.py	Thu Oct 10 12:22:15 2019 +0200
@@ -1156,7 +1156,7 @@
 
         # is reset to 0 at the beginning of printitem()
 
-        linesprinted = (xstart + len(t)) / self.xscreensize
+        linesprinted = (xstart + len(t)) // self.xscreensize
         self.linesprintedtopadsofar += linesprinted
         return t