aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-02-03 13:27:39 +1100
committerJussi Pakkanen <jpakkane@gmail.com>2016-02-03 13:27:58 +1100
commit6a3e29ccd47ac7c20de1c28de8b6323fa7c77ae2 (patch)
treed6842d545c5e3e09b079bd961e885b3a995ba680
parent4b3c43649eef34ced681d76f515113038117492e (diff)
downloadmeson-6a3e29ccd47ac7c20de1c28de8b6323fa7c77ae2.zip
meson-6a3e29ccd47ac7c20de1c28de8b6323fa7c77ae2.tar.gz
meson-6a3e29ccd47ac7c20de1c28de8b6323fa7c77ae2.tar.bz2
If test exes can not be removed (because e.g. an antivirus program holds on to the file), just leave them behind. Closes #378.
-rw-r--r--mesonbuild/compilers.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/compilers.py b/mesonbuild/compilers.py
index ec0181e..078e87c 100644
--- a/mesonbuild/compilers.py
+++ b/mesonbuild/compilers.py
@@ -437,7 +437,13 @@ int someSymbolHereJustForFun;
se = se.decode()
mlog.debug('Program stdout:\n', so)
mlog.debug('Program stderr:\n', se)
- os.remove(exename)
+ try:
+ os.remove(exename)
+ except PermissionError:
+ # On Windows antivirus programs and the like hold
+ # on to files so they can't be deleted. There's not
+ # much to do in this case.
+ pass
return RunResult(True, pe.returncode, so, se)
def cross_sizeof(self, element, prefix, env, extra_args=[]):