Skip to content

Commit

Permalink
feat(error): Show SyntaxError found in frappe (frappe#759)
Browse files Browse the repository at this point in the history
  • Loading branch information
adityahase authored and netchampfaris committed Jan 19, 2019
1 parent 518b8f3 commit 1497f9b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bench/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ def get_frappe_commands(bench_path='.'):
output = get_cmd_output("{python} -m frappe.utils.bench_helper get-frappe-commands".format(python=python), cwd=sites_path)
# output = output.decode('utf-8')
return json.loads(output)
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
if e.stderr:
print(e.stderr.decode('utf-8'))
return []

def get_frappe_help(bench_path='.'):
Expand Down
2 changes: 1 addition & 1 deletion bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def check_git_for_shallow_clone():

def get_cmd_output(cmd, cwd='.'):
try:
output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, 'wb')).strip()
output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=subprocess.PIPE).strip()
output = output.decode('utf-8')
return output
except subprocess.CalledProcessError as e:
Expand Down

0 comments on commit 1497f9b

Please sign in to comment.