From f4cb08fa19244c7cd666b18637cd4b796bbd77b1 Mon Sep 17 00:00:00 2001 From: Viktor Ershov Date: Tue, 29 Jan 2019 19:56:26 -0800 Subject: [PATCH] Fix tests to work without python 3.4 --- tests/e2e/executors/java.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/executors/java.py b/tests/e2e/executors/java.py index 44a79588..9eb62776 100644 --- a/tests/e2e/executors/java.py +++ b/tests/e2e/executors/java.py @@ -24,8 +24,8 @@ def predict(self, X): "Executor", "Model", "score" ] exec_args.extend(map(str, X)) - result = subprocess.run(exec_args, stdout=subprocess.PIPE) - items = result.stdout.decode("utf-8").split(" ") + result = subprocess.Popen(exec_args, stdout=subprocess.PIPE) + items = result.stdout.read().decode("utf-8").split(" ") if len(items) == 1: return float(items[0]) else: @@ -51,4 +51,4 @@ def prepare(self): # Compile all files together. exec_args = [self._javac_bin] + files_to_compile + ( [os.path.join(self._resource_tmp_dir, "Executor.java")]) - subprocess.run(exec_args) + subprocess.call(exec_args)