From b4f7141449fd5a9f9c32509161dd47ddfdb85e20 Mon Sep 17 00:00:00 2001 From: "g@localhost.localdomain" Date: Sat, 19 Aug 2006 23:24:55 +0200 Subject: [PATCH] Better error reporting. --- core/compute_size.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/compute_size.py b/core/compute_size.py index 8d68e86..8ac68cc 100644 --- a/core/compute_size.py +++ b/core/compute_size.py @@ -40,7 +40,7 @@ def fast(path, dir_ino): size = st.st_blocks * 512 return size except OSError, e: - print 'size', e + print 'size.fast(%)' % (path), e return 0 def slow(path): @@ -62,5 +62,9 @@ def slow(path): if os.path.samefile(path, '.'): return os.path.dirname(os.getcwd()) return '.' - parent = parent_path() + try: + parent = parent_path() + except OSError, e: + print 'size.slow(%s)' % (path), e + return 0 return fast(path, get_dev_ino(parent)[1]) -- 2.11.4.GIT