diff options
author | Sergio Martins <smartins@kde.org> | 2019-10-07 22:58:30 +0100 |
---|---|---|
committer | Sergio Martins <smartins@kde.org> | 2019-10-07 22:58:30 +0100 |
commit | 7616ce83efd24c56204d203d138bfb6cdaba7055 (patch) | |
tree | f3b60a0f6acf17266cde33bec93d0c7b1fe6908d | |
parent | 44ea3bf4b4a9afbb51f5a0b715af6440a5bc1a7b (diff) |
tests: Fix a python exception on Windows
Probably related to the migration to python3
-rwxr-xr-x | tests/run_tests.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/run_tests.py b/tests/run_tests.py index 653048ee..8e871b33 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -134,7 +134,13 @@ def get_command_output(cmd, test_env = os.environ): try: if _verbose: print(cmd) - output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True, env=test_env) + + # Polish up the env to fix "TypeError: environment can only contain strings" exception + str_env = {} + for key in test_env.keys(): + str_env[str(key)] = str(test_env[key]) + + output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True, env=str_env) except subprocess.CalledProcessError as e: output = e.output success = False |