Skip to content
Prev Previous commit
Next Next commit
Update Lib/tkinter/__init__.py
Co-authored-by: Terry Jan Reedy <[email protected]>
  • Loading branch information
chrstphrchvz and terryjreedy authored Apr 22, 2023
commit a293a6b98485605233661fd246dcb09a95a69359
3 changes: 1 addition & 2 deletions Lib/tkinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3430,8 +3430,7 @@ def entryconfigure(self, index, cnf=None, **kw):
def index(self, index):
"""Return the index of a menu item identified by INDEX."""
i = self.tk.call(self._w, 'index', index)
if i in ('', 'none'): return None
return self.tk.getint(i)
return None if i in ('', 'none') else self.tk.getint(i) # GH-103685.

def invoke(self, index):
"""Invoke a menu item identified by INDEX and execute
Expand Down