From b153d873cff654aab847f481d1626469983c2767 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Tue, 19 Oct 2010 13:33:36 +0000 Subject: [PATCH] Handle gclient_utils.Error exceptions in trychange.py TEST=none BUG=none Review URL: http://codereview.chromium.org/3853003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@63047 0039d316-1c4b-4281-b951-d872f2087c98 --- trychange.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trychange.py b/trychange.py index bdfc02e72..e76ebba02 100755 --- a/trychange.py +++ b/trychange.py @@ -609,7 +609,8 @@ def TryChange(argv, plural = "" if len(args) > 2: plural = "s" - print "Argument%s \"%s\" not understood" % (plural, " ".join(args[1:])) + print >> sys.stderr, ( + 'Argument%s \"%s\" not understood' % (plural, ' '.join(args[1:]))) parser.print_help() return 1 @@ -746,7 +747,10 @@ def TryChange(argv, except (InvalidScript, NoTryServerAccess), e: if swallow_exception: return 1 - print e + print >> sys.stderr, e + return 1 + except gclient_utils.Error, e: + print >> sys.stderr, e return 1 return 0