]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge Py Idle changes:
authorKurt B. Kaiser <kbk@shore.net>
Wed, 18 Sep 2002 03:26:47 +0000 (03:26 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Wed, 18 Sep 2002 03:26:47 +0000 (03:26 +0000)
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)

Lib/idlelib/TreeWidget.py

index ebc7be01ca408c94457ceb00cc21882b0783cf7e..d7132648ac2df6127d19761b6c2164cd57b0cb60 100644 (file)
@@ -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()