summaryrefslogtreecommitdiff
blob: 640348b2bc2df6c53df05d2a0add26d746a214ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 65192af2ff62a032a3f19d065c95e12b83aae709 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@collabora.com>
Date: Fri, 11 Jan 2019 18:03:15 +0000
Subject: [PATCH] run_unittests: Use Python 3.5-compatible subprocess
 invocation

subprocess.run() didn't get the encoding parameter until 3.6.

Signed-off-by: Simon McVittie <smcv@collabora.com>
---
 run_unittests.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/run_unittests.py b/run_unittests.py
index 342ad883..e1246140 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -5029,10 +5029,9 @@ class NativeFileTests(BasePlatformTests):
                     ret = subprocess.run(
                         ["{}"] + extra_args,
                         stdout=subprocess.PIPE,
-                        stderr=subprocess.PIPE,
-                        encoding='utf-8')
-                    print(ret.stdout)
-                    print(ret.stderr, file=sys.stderr)
+                        stderr=subprocess.PIPE)
+                    print(ret.stdout.decode('utf-8'))
+                    print(ret.stderr.decode('utf-8'), file=sys.stderr)
                     sys.exit(ret.returncode)
 
                 if __name__ == '__main__':
-- 
2.21.0