Error reporting if deletion fails.

This commit is contained in:
Anthony Plunkett 2016-02-09 17:28:51 -04:00
parent 441b47fb55
commit f06f96cc3a
1 changed files with 7 additions and 1 deletions

View File

@ -103,7 +103,13 @@ def main():
print 'Aborted!'
sys.exit()
shutil.rmtree(get_location())
def report_error(func, path, excinfo):
print('Problem deleting {}, {}, {}'.format(func, path, excinfo))
print('Please try and delete {} manually'.format(get_location())
print('Aborted!')
sys.exit()
shutil.rmtree(get_location(), onerror=report_error)
print ' Installing at: %s' % install_dir