use shutil.rmtree() instead of calling 'rm -rf' for increased portability

This commit is contained in:
Axel Kohlmeyer
2018-11-28 20:46:50 -05:00
parent a4d21370bf
commit eda79bd1c2
8 changed files with 20 additions and 30 deletions

View File

@ -143,8 +143,8 @@ fp.close()
if makeflag:
print("Building libgpu.a ...")
cmd = "rm -f libgpu.a"
subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
if os.path.exists("libgpu.a"):
os.remove("libgpu.a")
cmd = "make -f Makefile.auto clean; make -f Makefile.auto"
txt = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
print(txt.decode('UTF-8'))