From d16ac8f3ce8819af93a790f5ff0c0ae3e83590b2 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 23 Jan 2015 20:08:20 +0100 Subject: [PATCH] Fix deleting of directories in link_pyqt. --- scripts/init_venv.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/init_venv.py b/scripts/init_venv.py index 193540a01..3f77267d9 100644 --- a/scripts/init_venv.py +++ b/scripts/init_venv.py @@ -164,7 +164,10 @@ def link_pyqt(): if not os.path.exists(source): raise FileNotFoundError(source) if os.path.exists(dest): - os.unlink(dest) + if os.path.isdir(dest): + shutil.rmtree(dest) + else: + os.unlink(dest) if os.name == 'nt': if os.path.isdir(source): shutil.copytree(source, dest, ignore=get_ignored_files,