From: Kurt B. Kaiser Date: Wed, 18 Sep 2002 03:26:47 +0000 (+0000) Subject: Merge Py Idle changes: X-Git-Tag: v2.3c1~4030 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a5e350265ccc3c8ffe2f3cc66854f4a341da432;p=thirdparty%2FPython%2Fcpython.git Merge Py Idle changes: Rev 1.6 GvR Finally fix SF bug #441172, using a variant of patch ##443626: canceling an edit operation would not revert the value of the field. The fix takes care to destroy the Entry object, as suggested in the patch. Rev 1.7 Geiger Ho / GvR (previously applied - Idlefork Rev 1.3) Rev 1.8 doerwalter (string methods) --- diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py index ebc7be01ca40..d7132648ac2d 100644 --- a/Lib/idlelib/TreeWidget.py +++ b/Lib/idlelib/TreeWidget.py @@ -16,7 +16,6 @@ import os import sys -import string from Tkinter import * import imp @@ -291,6 +290,12 @@ class TreeNode: self.canvas.focus_set() def edit_cancel(self, event=None): + try: + entry = self.entry + del self.entry + except AttributeError: + return + entry.destroy() self.drawtext() self.canvas.focus_set()