setup.py: Fix error handling in uninstall command
This commit is contained in:
parent
c955d488f9
commit
0ef56b3a58
6
setup.py
6
setup.py
|
@ -142,7 +142,8 @@ class Uninstall(Command):
|
||||||
print("removing file %s" % entry)
|
print("removing file %s" % entry)
|
||||||
os.unlink(entry)
|
os.unlink(entry)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
error(e)
|
print(e)
|
||||||
|
return
|
||||||
|
|
||||||
directory = os.path.dirname(entry)
|
directory = os.path.dirname(entry)
|
||||||
while os.listdir(directory) == []:
|
while os.listdir(directory) == []:
|
||||||
|
@ -150,7 +151,8 @@ class Uninstall(Command):
|
||||||
print("removing empty directory %s" % directory)
|
print("removing empty directory %s" % directory)
|
||||||
os.rmdir(directory)
|
os.rmdir(directory)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
error(e)
|
print(e)
|
||||||
|
break
|
||||||
directory = os.path.dirname(directory)
|
directory = os.path.dirname(directory)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
|
Loading…
Reference in New Issue