From: Roger Serwy Date: Sun, 7 Apr 2013 17:41:16 +0000 (-0500) Subject: #17613: Prevent traceback when removing syntax colorizer in IDLE. X-Git-Tag: v2.7.5~94 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4e9a705887eae52de9acdbdc988e73090da01248;p=thirdparty%2FPython%2Fcpython.git #17613: Prevent traceback when removing syntax colorizer in IDLE. --- diff --git a/Lib/idlelib/ColorDelegator.py b/Lib/idlelib/ColorDelegator.py index 0610c4b6aac3..c74865d4fb43 100644 --- a/Lib/idlelib/ColorDelegator.py +++ b/Lib/idlelib/ColorDelegator.py @@ -50,6 +50,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 abb5068e3dcf..e2ed81c289e0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -23,6 +23,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.