Sublime Forum

BUILD: long delay after program runs

#1

Dear Tech Support,

I’m running Sublime Text 3 version 3.2.2 (Build 3211) on macOS 10.15.5 (Catalina) with Python 3.7.

When I build my program (CMD-B) it runs and completes successfully in less than one second. The last thing the program does is it prints “Program complete.”
However, about 20 seconds later I get the “Finished in…” message.

Program complete # (takes less than 1 second to run)
[Finished in 20.5s]

I’m wondering what is going on for 20 seconds after my program is done.

By the way, when I run “Hello World” I get the expected result:

Hello World!
[Finished in 0.0s]

Any ideas?

Cheers,
Martin

0 Likes

#2

Without seeing the code, it’s hard to say what might be going wrong. Generally speaking, the [Finished] diagnostic is generated when the task that the build launched terminates, so from that standpoint the first guess would be that somehow the code is taking some longer action than you expect (like releasing memory or cleaning up temporary files, etc).

Between the point that the program is done and the message is displayed, is Sublime still responsive to user input?

0 Likes

#3

Yes, ST is responsive to the user during the 20 second delay.
I removed 90% of the code to find the minimum program that still exhibits the problem. See below.

------ CONSOLE OUTPUT ------
Program complete
[Finished in 20.4s]

When this program runs the call to image.show() launches PREVIEW.APP
to display a square image. PREVIEW.APP is the default image viewer on MacOS.
This takes about one second. And then it then prints ‘Program complete’ to the console.

Then there is a 20 second delay, during which Sublime Text 3 is responsive
to the user. It then prints ‘[Finished in 20.4s]’ to the console.

draw-grid-V6.py

from PIL import Image
image = Image.new(mode=‘L’, size=(200, 200), color=’#333333’)
image.show()
print(‘Program complete’)

0 Likes