Skip to content

Commit c616144

Browse files
committed
refactor: dont use try-except for control flow
1 parent 3fa3dce commit c616144

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

discopop_wizard/wizard.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
# todo add command line option to execute run configuration (by name)
2626
from discopop_wizard.screens.settings import show_settings_screen, save_settings
2727

28+
from discopop_wizard.utils import get_platform, Platform
29+
2830

2931
def main(arguments: Arguments):
3032
print("starting DiscoPoP Wizard...\n")
@@ -113,10 +115,10 @@ def check():
113115
warnings.warn("Loading the window icon was not successful.")
114116

115117
# set window to full screen
116-
try:
117-
self.window.attributes('-zoomed', True)
118-
except tk.TclError: # above does not work on macOS
118+
if get_platform() in (Platform.OSX, Platform.WINDOWS):
119119
self.window.state("zoomed")
120+
else:
121+
self.window.attributes('-zoomed', True)
120122
self.window.columnconfigure(1, weight=1)
121123
self.window.rowconfigure(1, weight=1)
122124
paned_window = ttk.PanedWindow(self.window, orient=tk.VERTICAL)

0 commit comments

Comments
 (0)