101 elif checked_ez_button.name == "btnOpenFolder":
102 try:
103 os.startfile(os.path.join(os.getcwd(), "Resources/Images/Saved_fractals/"))
104 except Exception as e:105 print("Error: ", e)
106 try:
107 os.system("xdg-open " + os.path.join(os.getcwd(), "Resources/Images/Saved_fractals/"))
105 print("Error: ", e)
106 try:
107 os.system("xdg-open " + os.path.join(os.getcwd(), "Resources/Images/Saved_fractals/"))
108 except Exception as e:109 print("Error: ", e)
110 checked_ez_button.create_button()
111
135 print("Error: ", e)
136 try:
137 os.system("xdg-open " + "CONFIG.ini")
138 except Exception as e:139 print("Error: ", e)
140 if any(
141 complex_button.check_hover(mouse_x, mouse_y)
131 elif checked_complex_button.name == "btnSettings":
132 try:
133 os.startfile("CONFIG.ini")
134 except Exception as e:135 print("Error: ", e)
136 try:
137 os.system("xdg-open " + "CONFIG.ini")
109 elif checked_complex_button.name == "btnGithub":
110 try:
111 webbrowser.open("https://github.com/Wokia-Dev/EzFractal")
112 except Exception as e:113 print("Error: ", e)
114 elif checked_complex_button.name == "btnPopular":
115 load_popular_app()
If the except block catches a very general exception, it is likely to catch any unrelated errors too. Try to be more explicit about which exception(s) you're trying to catch.
If you need to catch every other exception, then mark it as intentional by
adding a # skipcq
comment.
try:
x = a / b
except Exception:
x = a / (b + 1)
try:
line = input('Enter numbers:')
numbers = [int(i) for i in line.split()]
except BaseException:
print('Only use numbers for the input')
try:
x = a / b
except ZeroDivisionError:
x = a / (b + 1)
try:
event_loop.run()
except Exception as exc: # skipcq: PYL-W0703 - Loop can sometimes crash.
sentry.report(exc)
try:
line = input('Enter numbers:')
numbers = [int(i) for i in line.split()]
except ValueError:
print('Only use numbers for the input')