From: Roger Serwy Date: Sun, 7 Apr 2013 17:15:52 +0000 (-0500) Subject: #1207589: Backwards-compatibility patch for right-click menu in IDLE. X-Git-Tag: v2.7.5~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=231a8fd22dcb60b2090e05029a536df73ef44373;p=thirdparty%2FPython%2Fcpython.git #1207589: Backwards-compatibility patch for right-click menu in IDLE. --- diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index 96f1ee587848..cf3fad3c1ec1 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -480,7 +480,12 @@ class EditorWindow(object): if iswin: self.text.config(cursor="arrow") - for label, eventname, verify_state in self.rmenu_specs: + for item in self.rmenu_specs: + try: + label, eventname, verify_state = item + except ValueError: # see issue1207589 + continue + if verify_state is None: continue state = getattr(self, verify_state)() @@ -497,7 +502,8 @@ class EditorWindow(object): def make_rmenu(self): rmenu = Menu(self.text, tearoff=0) - for label, eventname, _ in self.rmenu_specs: + for item in self.rmenu_specs: + label, eventname = item[0], item[1] if label is not None: def command(text=self.text, eventname=eventname): text.event_generate(eventname) diff --git a/Misc/NEWS b/Misc/NEWS index 3d9e9dcb581b..abb5068e3dcf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -23,6 +23,8 @@ Library IDLE ---- +- Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE. + - Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box. - Issue #14254: IDLE now handles readline correctly across shell restarts.