Only try and delete if exists!
This commit is contained in:
parent
f06f96cc3a
commit
6db7d177ae
|
@ -33,6 +33,12 @@ def find_location():
|
||||||
return None, None
|
return None, None
|
||||||
return install_dir, os.path.join(install_dir, LIB)
|
return install_dir, os.path.join(install_dir, LIB)
|
||||||
|
|
||||||
|
def deletion_error(func, path, excinfo):
|
||||||
|
print 'Problem deleting {}'.format(path)
|
||||||
|
print 'Please try and delete {} manually'.format(path)
|
||||||
|
print 'Aborted!'
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
def fail(message):
|
def fail(message):
|
||||||
print 'Error: %s' % message
|
print 'Error: %s' % message
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -98,20 +104,12 @@ def main():
|
||||||
).lower().strip()
|
).lower().strip()
|
||||||
|
|
||||||
if input in ('', 'y'):
|
if input in ('', 'y'):
|
||||||
|
shutil.rmtree(get_location())
|
||||||
break
|
break
|
||||||
elif input == 'n':
|
elif input == 'n':
|
||||||
print 'Aborted!'
|
print 'Aborted!'
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
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
|
print ' Installing at: %s' % install_dir
|
||||||
while 1:
|
while 1:
|
||||||
input = raw_input('Continue? [Yn] ').lower().strip()
|
input = raw_input('Continue? [Yn] ').lower().strip()
|
||||||
|
|
Loading…
Reference in New Issue