From: Andrew M. Kuchling Date: Thu, 2 Jun 2005 00:11:55 +0000 (+0000) Subject: [Bug #1152762] Ensure _end_of_line() returns an x-coordinate that's within the text box X-Git-Tag: v2.4.2c1~213 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=270dfd86b41d90b7b27c1f61fe87a118bebd12ac;p=thirdparty%2FPython%2Fcpython.git [Bug #1152762] Ensure _end_of_line() returns an x-coordinate that's within the text box --- diff --git a/Lib/curses/textpad.py b/Lib/curses/textpad.py index 28d78dd5cd38..120c5721ee73 100644 --- a/Lib/curses/textpad.py +++ b/Lib/curses/textpad.py @@ -53,7 +53,7 @@ class Textbox: last = self.maxx while 1: if ascii.ascii(self.win.inch(y, last)) != ascii.SP: - last = last + 1 + last = min(self.maxx, last+1) break elif last == 0: break