From 3341849a69ee99b376ff7878ea7e6dd889d73d50 Mon Sep 17 00:00:00 2001 From: "szager@chromium.org" Date: Wed, 18 Jun 2014 19:03:39 +0000 Subject: [PATCH] Don't os.listdir() on a non-existent dir (it raises). TBR=agable@chromium.org,iannucci@chromium.org BUG= Review URL: https://codereview.chromium.org/342753003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@278141 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cache.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git_cache.py b/git_cache.py index ca21a3c94..1b135d50b 100755 --- a/git_cache.py +++ b/git_cache.py @@ -399,6 +399,8 @@ class Mirror(object): @staticmethod def DeleteTmpPackFiles(path): pack_dir = os.path.join(path, 'objects', 'pack') + if not os.path.isdir(pack_dir): + return pack_files = [f for f in os.listdir(pack_dir) if f.startswith('.tmp-') or f.startswith('tmp_pack_')] for f in pack_files: