Removed redundant try catch

This commit is contained in:
Andrew Murray 2022-02-07 21:06:36 +11:00
parent c6b81d5989
commit 3114064b16

View File

@ -64,7 +64,7 @@ def _pyimagingtkcall(command, photo, id):
tk.call(command, photo, id) tk.call(command, photo, id)
except tkinter.TclError: except tkinter.TclError:
# activate Tkinter hook # activate Tkinter hook
try: # may raise an error if it cannot attach to Tkinter
from . import _imagingtk from . import _imagingtk
try: try:
@ -83,8 +83,6 @@ def _pyimagingtkcall(command, photo, id):
except AttributeError: except AttributeError:
_imagingtk.tkinit(id(tk), 0) _imagingtk.tkinit(id(tk), 0)
tk.call(command, photo, id) tk.call(command, photo, id)
except (ImportError, AttributeError, tkinter.TclError):
raise # configuration problem; cannot attach to Tkinter
# -------------------------------------------------------------------- # --------------------------------------------------------------------