File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -135,12 +135,15 @@ def __init__(
135
135
self ._save_path = None
136
136
self ._unsaved_changes = False
137
137
138
- # start the blocking non-daemon post-initialization thread to leave the main thread free for the GUI (limitation of MacOS)
139
- Thread (target = self .post_init , args = (filepath , duration ), daemon = False ).start ()
138
+ if self .headless :
139
+ # there is no GUI, so we can run everything in the main thread
140
+ self .post_init (filepath , duration )
141
+ else :
142
+ # start the blocking non-daemon post-initialization thread to leave the main thread free for the GUI (limitation of MacOS)
143
+ Thread (target = self .post_init , args = (filepath , duration ), daemon = False ).start ()
140
144
141
- # initialize the GUI
142
- # NOTE: this is a blocking call, so it must be the last thing we do
143
- if not self .headless :
145
+ # initialize the GUI
146
+ # NOTE: this is a blocking call, so it must be the last thing we do
144
147
Window (self )
145
148
146
149
def post_init (self , filepath : Optional [str ] = None , duration : float = 0 ) -> None :
You can’t perform that action at this time.
0 commit comments