Skip to content

Commit 1bd442d

Browse files
author
Greg Leclercq
committed
Update execute.python(): report raw errors found in stderr such as import errors
1 parent 17b80c1 commit 1bd442d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

simpleflow/execute.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,17 @@ def execute(*args, **kwargs):
153153
excline = exclines[0]
154154
else:
155155
excline = exclines[1]
156-
exception = pickle.loads(
157-
base64.b64decode(excline.rstrip()))
156+
157+
try:
158+
exception = pickle.loads(
159+
base64.b64decode(excline.rstrip()))
160+
except TypeError:
161+
cls, msg = exclines[-1].split(':', 1)
162+
exception = eval('{}("{}")'.format(
163+
cls.strip(),
164+
msg.strip(),
165+
))
166+
158167
raise exception
159168
return json.loads(output)
160169

0 commit comments

Comments
 (0)