Just use shutil.rmtree in build.py

Turns out there's a stdlib function for this.

Change-Id: I38885c4b6d973b2a7083a04acb3f5cea9ad78ad9
This commit is contained in:
Monty Taylor 2020-03-01 06:13:59 -06:00
parent 86670bcec9
commit 4df2fdb4fe

View File

@ -22,7 +22,7 @@ import pbr.version
from ruamel.yaml import YAML
import os
import shutil
def generate_version_info():
@ -41,16 +41,9 @@ def generate_version_info():
yaml.dump(config, fp)
def clean_build():
if not os.path.exists('build_artifact'):
return
for tarball in os.listdir('build_artifact'):
os.unlink('build_artifact/{tarball}'.format(tarball=tarball))
def main():
generate_version_info()
clean_build()
shutil.rmtree('build_artifact', ignore_errors=True)
if __name__ == '__main__':