Skip to content

Commit

Permalink
Python 3 fixes for galaxy.tools.expressions.evaluation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmchilton committed Mar 19, 2019
1 parent 6b4a6f0 commit 88a9b06
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/galaxy/tools/expressions/evaluation.py
Expand Up @@ -27,11 +27,12 @@ def evaluate(config, input):
close_fds=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)

(stdoutdata, stderrdata) = sp.communicate(json.dumps(new_input) + "\n\n")
input_str = json.dumps(new_input) + "\n\n"
input_bytes = input_str.encode("utf-8")
(stdoutdata, stderrdata) = sp.communicate(input_bytes)
if sp.returncode != 0:
args = (json.dumps(new_input, indent=4), stdoutdata, stderrdata)
message = "Expression engine returned non-zero exit code on evaluation of\n%s%s%s" % args
raise Exception(message)

return json.loads(stdoutdata)
return json.loads(stdoutdata.decode("utf-8"))

0 comments on commit 88a9b06

Please sign in to comment.