aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIikka Eklund <iikka.eklund@qt.io>2019-05-29 08:36:14 +0300
committerAntti Kokko <antti.kokko@qt.io>2019-08-22 09:18:38 +0000
commit3ffacfb6ae46ed2e5eddac3192921d37aabe957d (patch)
tree535094c42a95f6946a76ba86870ef62f9e00fdfc
parent410dcdd0beaab02cc2c94acfd88c43cb9ea0dd3c (diff)
bldinstallercommon.py: use shutil.rmtree instead of native call
Invoking native shell command via subprocess is slow and there exists shutil.rmtree which should be preferred anyways. Change-Id: Iaf47334e0617dedbb11dfc63f2b3cd92cc5393fb Reviewed-by: Antti Kokko <antti.kokko@qt.io>
-rw-r--r--packaging-tools/bldinstallercommon.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/packaging-tools/bldinstallercommon.py b/packaging-tools/bldinstallercommon.py
index ddad07a89..a3518dfd8 100644
--- a/packaging-tools/bldinstallercommon.py
+++ b/packaging-tools/bldinstallercommon.py
@@ -365,16 +365,7 @@ def remove_tree(path):
if os.path.isdir(path) and os.path.exists(path):
if IS_WIN_PLATFORM:
path = win32api.GetShortPathName(path.replace('/', '\\'))
- #a funny thing is that rmdir does not set an exitcode it is just using the last set one
- try:
- runCommand(['rmdir', path, '/S', '/Q'], SCRIPT_ROOT_DIR, onlyErrorCaseOutput=True)
- except:
- traceback.print_exc()
- pass
- else:
- #shutil.rmtree(path)
- runCommand(['rm', '-rf', path], SCRIPT_ROOT_DIR, onlyErrorCaseOutput=True)
- return not os.path.exists(path)
+ shutil.rmtree(path)
###############################