What is the best practice approach for trapping Tkinter exceptions? Example: When using the Text widget with undo=True, attempting an edit_undo or edit_redo raises a Tkinter exception when there are no actions to undo or redo.
It doesn't look like there's a Tkinter specific exception being raised - only a general exception. Is there a better way to trap Tkinter exceptions than wrapping certain Tkinter commands like the following: try: widget_with_focus.edit_undo() except Exception as e: pass If I print the exception that I trapped, all I get is the name of the Tkinter method I tried to execute, eg. edit_undo. For bonus points: Is there a way to query a Tkinter Text widget to determine if there are undo or redo actions available to apply? Malcolm
-- http://mail.python.org/mailman/listinfo/python-list