Skip to content

Commit 9fd5024

Browse files
committed
Update output for the seleniumbase behave GUI runner
1 parent 759c6cb commit 9fd5024

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

seleniumbase/console_scripts/sb_behave_gui.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,22 @@ def do_behave_run(
156156
full_run_command += " -k"
157157

158158
print(full_run_command)
159-
subprocess.Popen(full_run_command, shell=True)
159+
if not additional_options or " " not in additional_options:
160+
subprocess.Popen(full_run_command, shell=True)
161+
else:
162+
proc = subprocess.Popen(
163+
full_run_command, stderr=subprocess.PIPE, shell=True
164+
)
165+
(output, error) = proc.communicate()
166+
if error and proc.returncode == 2:
167+
if str(error).startswith("b'") and str(error).endswith("\\n'"):
168+
error = str(error)[2:-3]
169+
elif str(error).startswith("b'") and str(error).endswith("'"):
170+
error = str(error)[2:-1]
171+
else:
172+
error = str(error)
173+
error = error.replace("\\n", "\n")
174+
print(error)
160175
send_window_to_front(root)
161176

162177

0 commit comments

Comments
 (0)