mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
let the download script remove the extraction folder in case it exists
This commit is contained in:
parent
689be6529d
commit
6ec984bbd5
|
@ -8,6 +8,12 @@ def unzip(filename, where):
|
|||
z = zipfile.ZipFile(filename, "r")
|
||||
except:
|
||||
return False
|
||||
|
||||
# remove extraction folder, if it exists
|
||||
if os.path.exists(z.namelist()[0]):
|
||||
shutil.rmtree(z.namelist()[0])
|
||||
|
||||
# extract files
|
||||
for name in z.namelist():
|
||||
z.extract(name, where)
|
||||
z.close()
|
||||
|
|
Loading…
Reference in a new issue