From 1c06094202f2254f33ce05bcebf227c95712d7b3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 15 Nov 2022 16:16:57 -0500 Subject: Fix potential Python errors on test suite failure --- test/run_test_suite.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/run_test_suite.py b/test/run_test_suite.py index 3ea0c604..94571f72 100755 --- a/test/run_test_suite.py +++ b/test/run_test_suite.py @@ -159,11 +159,11 @@ def _load_rdf(filename, base_uri, command_prefix): instances = {} cmd = command_prefix + [filename, base_uri] - proc = subprocess.run(cmd, capture_output=True, check=True) + proc = subprocess.run( + cmd, capture_output=True, encoding="utf-8", check=True + ) for line in proc.stdout.splitlines(): - matches = re.match( - r"<([^ ]*)> <([^ ]*)> <([^ ]*)> \.", line.decode("utf-8") - ) + matches = re.match(r"<([^ ]*)> <([^ ]*)> <([^ ]*)> \.", line) if matches: s, p, o = (matches.group(1), matches.group(2), matches.group(3)) if s not in model: @@ -398,7 +398,7 @@ if __name__ == "__main__": sys.exit(main()) except subprocess.CalledProcessError as e: if e.stderr is not None: - sys.stderr.write(e.stderr.decode("utf-8")) + sys.stderr.write(e.stderr) sys.stderr.write("error: %s\n" % e) sys.exit(e.returncode) -- cgit v1.2.1