summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/idlelib/TreeWidget.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/idlelib/TreeWidget.py b/Lib/idlelib/TreeWidget.py
index ebc7be0..d713264 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()