mirror of
https://github.com/pocketpy/pocketpy
synced 2025-11-06 19:50:16 +00:00
Only sleep between rmtree and mkdir on Windows machines
This makes amalgamate builds slightly faster on non-Windows machines.
This commit is contained in:
parent
40c31fd1d1
commit
a8bf40c7bf
@ -19,7 +19,12 @@ import time
|
||||
|
||||
if os.path.exists("amalgamated"):
|
||||
shutil.rmtree("amalgamated")
|
||||
time.sleep(1)
|
||||
if os.name == "nt":
|
||||
# On Windows, making a directory too soon after shutil.rmtree can fail
|
||||
# with PermissionError. Sleep for 1 second as a simple hedge against
|
||||
# this.
|
||||
# See https://stackoverflow.com/a/60181105/569183
|
||||
time.sleep(1)
|
||||
os.mkdir("amalgamated")
|
||||
|
||||
def remove_copied_include(text):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user