From 947f97446dcd9d56b1def3b7d0523105cd059148 Mon Sep 17 00:00:00 2001 From: MP3Martin <60501493+MP3Martin@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:55:54 +0100 Subject: [PATCH] Fix 5 Maintainability issues in Tkinter_GUI\gui.py --- Tkinter_GUI/gui.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Tkinter_GUI/gui.py b/Tkinter_GUI/gui.py index 3c186a0..a32b31f 100644 --- a/Tkinter_GUI/gui.py +++ b/Tkinter_GUI/gui.py @@ -9,7 +9,7 @@ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) try: import real_division_core as rdc -except: +except Exception: #import failed sys.path.pop() import real_division_core as rdc @@ -254,7 +254,7 @@ def addFirstZero(input): try: master.tk.call("source", str(themePath)) master.tk.call("set_theme", "dark") -except: +except Exception: print("Could not load the theme :/") master.after(500, lambda: messagebox.showerror("Error", "Could not load the theme :(\nYou can still use this program.")) @@ -281,7 +281,7 @@ def is_num(text): try: num = int(text) return True - except: + except Exception: return False def is_num_second(test_str): @@ -558,7 +558,7 @@ def select_all(event): def copy_selected(event): try: selected_text = event.widget.get(tk.SEL_FIRST, tk.SEL_LAST) - except: + except Exception: selected_text = "None" selected_text = str(selected_text) widget = str(event.widget).replace(".!frame.!","") @@ -597,7 +597,7 @@ def deselect_selected(event): def custom_paste(event): try: event.widget.delete("sel.first", "sel.last") - except: + except Exception: pass event.widget.insert("insert", event.widget.clipboard_get()) return "break"