diff --git a/gcl.py b/gcl.py index 413e2bb6d..f64f67221 100755 --- a/gcl.py +++ b/gcl.py @@ -1119,8 +1119,12 @@ def CMDchange(args): if sys.platform == 'win32' and os.environ.get('TERM') == 'msys': # Msysgit requires the usage of 'env' to be present. cmd = 'env ' + cmd - # shell=True to allow the shell to handle all forms of quotes in $EDITOR. - subprocess.check_call(cmd, shell=True) + try: + # shell=True to allow the shell to handle all forms of quotes in + # $EDITOR. + subprocess.check_call(cmd, shell=True) + except subprocess.CalledProcessError, e: + ErrorExit('Editor returned %d' % e.returncode) result = gclient_utils.FileRead(filename, 'r') finally: os.remove(filename) diff --git a/git_cl.py b/git_cl.py index 9e1124c65..5cf2580e4 100755 --- a/git_cl.py +++ b/git_cl.py @@ -842,7 +842,10 @@ def UserEditedLog(starting_text): # Msysgit requires the usage of 'env' to be present. cmd = 'env ' + cmd # shell=True to allow the shell to handle all forms of quotes in $EDITOR. - subprocess.check_call(cmd, shell=True) + try: + subprocess.check_call(cmd, shell=True) + except subprocess.CalledProcessError, e: + DieWithError('Editor returned %d' % e.returncode) fileobj = open(filename) text = fileobj.read() fileobj.close()