From b6535bb1e9475eb3d62f05c7a65aaf067c842cd2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 1 Oct 2016 02:29:17 -0400 Subject: [PATCH] Fix portability of whatsnew test. Remove unnecessary use of `shell=True`, and use the correct Python interpreter (i.e., the same one that's running the tests.) --- lib/iris/tests/test_whatsnew_contributions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/iris/tests/test_whatsnew_contributions.py b/lib/iris/tests/test_whatsnew_contributions.py index 1dee1e7edc..be917e60d8 100644 --- a/lib/iris/tests/test_whatsnew_contributions.py +++ b/lib/iris/tests/test_whatsnew_contributions.py @@ -1,4 +1,4 @@ -# (C) British Crown Copyright 2010 - 2015, Met Office +# (C) British Crown Copyright 2010 - 2016, Met Office # # This file is part of Iris. # @@ -39,6 +39,7 @@ import os import os.path import subprocess +import sys import iris @@ -61,8 +62,9 @@ def test_check_contributions(self): # Travis bypasses this problem by running the test directly. if os.path.exists(whatsnew_dirpath): # Run a 'check contributions' command in that directory. - cmd = 'python aggregate_directory.py --checkonly --quiet' - subprocess.check_call(cmd, cwd=whatsnew_dirpath, shell=True) + cmd = [sys.executable, 'aggregate_directory.py', '--checkonly', + '--quiet'] + subprocess.check_call(cmd, cwd=whatsnew_dirpath) if __name__ == "__main__":