# HG changeset patch # User Denis Laxalde # Date 2019-10-10 10:22:15 # Node ID b0238700551593257f293fd838f2ac030d00cede # Parent ff615b6b5b8f03250dcc6fea1bf1a12f7fe526b7 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'). diff --git a/mercurial/crecord.py b/mercurial/crecord.py --- a/mercurial/crecord.py +++ b/mercurial/crecord.py @@ -1156,7 +1156,7 @@ class curseschunkselector(object): # 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