Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Update process_script.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Mar 22, 2019
1 parent d8d3ff6 commit 993e575
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pyquickhelper/loghelper/process_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ def execute_script(code, folder=None, filename="_temp_custom_run_script_.py", ch
proc = subprocess.Popen(cmdl, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
_, errs = proc.communicate()
errs = errs.decode('utf-8', errors="ignore")
if errs:
lines = errs.split('\n')
lines = [line for line in lines if "Warning" not in line and line and line[0] != ' ']
errs2 = "\n".join(lines).strip("\r\n ")
if errs2:
return {'ERROR': errs.decode('utf-8', errors="ignore")}
return {'ERROR': errs}
with open(data, "rb") as f:
loc = pickle.load(f)
return loc
Expand Down

0 comments on commit 993e575

Please sign in to comment.