]> granicus.if.org Git - python/commitdiff
#1207589: Backwards-compatibility patch for right-click menu in IDLE.
authorRoger Serwy <roger.serwy@gmail.com>
Sun, 7 Apr 2013 17:15:52 +0000 (12:15 -0500)
committerRoger Serwy <roger.serwy@gmail.com>
Sun, 7 Apr 2013 17:15:52 +0000 (12:15 -0500)
Lib/idlelib/EditorWindow.py
Misc/NEWS

index 810f5885585c4f8babf07f43d617ff326818bc1f..343b6e4230496294aa6e27f809b9980e8abaf507 100644 (file)
@@ -479,7 +479,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)
index 18a78344e74bb17ce8f97c30efed7cb402065c02..08dff45618f0d27c50ed5cc5a412f5023012595c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -33,6 +33,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 #17625: In IDLE, close the replace dialog after it is used.