From a2d7edf8fc767a635a4a21e8fa43430f865760d5 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Mon, 4 Apr 2011 17:53:45 +0000 Subject: [PATCH] gcl delete won't throw an exception anymore R=dpranke@chromium.org BUG= TEST= Review URL: http://codereview.chromium.org/6735029 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80337 0039d316-1c4b-4281-b951-d872f2087c98 --- gcl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcl.py b/gcl.py index 6136d1c5a..2b63e3677 100755 --- a/gcl.py +++ b/gcl.py @@ -1304,7 +1304,10 @@ def CMDdelete(args): """Deletes a changelist.""" if not len(args) == 1: ErrorExit('You need to pass a change list name') - os.remove(GetChangelistInfoFile(args[0])) + filepath = GetChangelistInfoFile(args[0]) + if not os.path.isfile(filepath): + ErrorExit('You need to pass a valid change list name') + os.remove(filepath) return 0