From 1497f9b14bbe00d49da90ac406ef1695a7458d85 Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Sat, 19 Jan 2019 13:12:21 +0530 Subject: [PATCH] feat(error): Show SyntaxError found in frappe (#759) --- bench/cli.py | 4 +++- bench/utils.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bench/cli.py b/bench/cli.py index c314d90a..7ac353df 100755 --- a/bench/cli.py +++ b/bench/cli.py @@ -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='.'): diff --git a/bench/utils.py b/bench/utils.py index 6ca27464..a1c41c06 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -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: