Auto merge of #22595 - shanavas786:remove-virtualenv, r=jdm

Delete virtualenv when executing mach clean

Closes #22588

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/22595)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2019-01-03 00:04:05 -05:00 committed by GitHub
commit a42f2f4f18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -622,6 +622,11 @@ class MachCommands(CommandBase):
def clean(self, manifest_path=None, params=[], verbose=False):
self.ensure_bootstrapped()
virtualenv_path = path.join(self.get_top_dir(), 'python', '_virtualenv')
if path.exists(virtualenv_path):
print('Removing virtualenv directory: %s' % virtualenv_path)
shutil.rmtree(virtualenv_path)
opts = []
if manifest_path:
opts += ["--manifest-path", manifest_path]