From d192f2fbdc64dfdcee4e55c89cf92bff43536032 Mon Sep 17 00:00:00 2001 From: "maruel@chromium.org" Date: Tue, 25 Sep 2012 15:22:19 +0000 Subject: Trap WindowsError if a file is missing and convert it into MappingError. This will print a better error message. R=csharp@chromium.org NOTRY=true BUG= Review URL: https://chromiumcodereview.appspot.com/10987020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158572 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/isolate/isolate.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/isolate/isolate.py b/tools/isolate/isolate.py index de3a256..ed5f8ac 100755 --- a/tools/isolate/isolate.py +++ b/tools/isolate/isolate.py @@ -440,7 +440,11 @@ def process_input(filepath, prevdict, level, read_only): # return out if level >= STATS_ONLY: - filestats = os.lstat(filepath) + try: + filestats = os.lstat(filepath) + except OSError: + # The file is not present. + raise run_test_from_archive.MappingError('%s is missing' % filepath) is_link = stat.S_ISLNK(filestats.st_mode) if get_flavor() != 'win': # Ignore file mode on Windows since it's not really useful there. -- cgit v1.1