diff --git a/benchmark.py b/benchmark.py index 4e1a975..e1cf06f 100644 --- a/benchmark.py +++ b/benchmark.py @@ -140,7 +140,10 @@ def benchmark(path, get_size=False): for root, dirs, files in os_walk_func(path): for filename in files: fullname = os.path.join(root, filename) - size += os.path.getsize(fullname) + try: + size += os.path.getsize(fullname) + except OSError: + pass sizes['os_walk'] = size def do_scandir_walk():