From a4848eb7419f14699f30bc91c7b7f47babc2d088 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 24 Jan 2020 23:36:22 +0000 Subject: fetchmailconf: Heed Exceptions in make_icon_window(). --- fetchmailconf.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/fetchmailconf.py b/fetchmailconf.py index c6885567..fef36fc5 100755 --- a/fetchmailconf.py +++ b/fetchmailconf.py @@ -552,18 +552,14 @@ def helpwin(helpdict): textframe.pack(side=TOP) def make_icon_window(base, image): - try: - # Some older pythons will error out on this - icon_image = PhotoImage(data=image) - icon_window = Toplevel() - Label(icon_window, image=icon_image, bg='black').pack() - base.master.iconwindow(icon_window) - # Avoid TkInter brain death. PhotoImage objects go out of - # scope when the enclosing function returns. Therefore - # we have to explicitly link them to something. - base.keepalive.append(icon_image) - except Exception: - pass + icon_image = PhotoImage(data=image) + icon_window = Toplevel() + Label(icon_window, image=icon_image, bg='black').pack() + base.master.iconwindow(icon_window) + # Avoid TkInter brain death. PhotoImage objects go out of + # scope when the enclosing function returns. Therefore + # we have to explicitly link them to something. + base.keepalive.append(icon_image) class ListEdit(Frame): # edit a list of values (duplicates not allowed) with a supplied editor hook -- cgit v1.2.3