venv: Fix removing of venv if it's linked.

This commit is contained in:
Florian Bruhin 2015-01-24 17:43:56 +01:00
parent 3edffefff4
commit b808aa07ba

View File

@ -164,7 +164,7 @@ def link_pyqt():
if not os.path.exists(source): if not os.path.exists(source):
raise FileNotFoundError(source) raise FileNotFoundError(source)
if os.path.exists(dest): if os.path.exists(dest):
if os.path.isdir(dest): if os.path.isdir(dest) and not os.path.islink(dest):
shutil.rmtree(dest) shutil.rmtree(dest)
else: else:
os.unlink(dest) os.unlink(dest)