From 76276177dea7d3e1412390e36a2c260f3f8107cb Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Thu, 2 Jun 2005 00:10:04 +0000 Subject: [PATCH] [Bug #1152762] Ensure _end_of_line() returns an x-coordinate that's within the text box --- Lib/curses/textpad.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/curses/textpad.py b/Lib/curses/textpad.py index 28d78dd5cd..120c5721ee 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 -- 2.40.0