import tarfile
import tempfile
-from time import time
+from time import time, sleep
# Acquire a lock on the build directory to make sure that
# we don't cause a race condition while building
while True:
try:
curs.execute("BEGIN EXCLUSIVE")
+ break
except sqlite3.OperationalError:
pass
+ sleep(0.25)
return curs
except ImportError:
print("warning: sqlite3 not available in python, skipping build directory lock")