From 7733be8f2612df4caad771795de40cabf66b287b Mon Sep 17 00:00:00 2001 From: Roger Serwy Date: Sun, 7 Apr 2013 12:41:16 -0500 Subject: [PATCH] #17613: Prevent traceback when removing syntax colorizer in IDLE. --- Lib/idlelib/ColorDelegator.py | 4 ++++ Misc/NEWS | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py index e4ccb4258c6..61e2be47c7e 100644 --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -51,6 +51,10 @@ class ColorDelegator(Delegator): self.config_colors() self.bind("<>", self.toggle_colorize_event) self.notify_range("1.0", "end") + else: + # No delegate - stop any colorizing + self.stop_colorizing = True + self.allow_colorizing = False def config_colors(self): for tag, cnf in self.tagdefs.items(): diff --git a/Misc/NEWS b/Misc/NEWS index 08dff45618f..25b4b53d408 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -33,6 +33,8 @@ Library IDLE ---- +- Issue #17613: Prevent traceback when removing syntax colorizer in IDLE. + - Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE. - Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.