mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Change get_size to return zero for a dir that doesn't exist.
This commit is contained in:
parent
10713d1e3c
commit
6f12be2340
1 changed files with 4 additions and 1 deletions
|
@ -1334,7 +1334,10 @@ def human(size):
|
|||
def get_size(start_path='.'):
|
||||
if ek.ek(os.path.isfile, start_path):
|
||||
return ek.ek(os.path.getsize, start_path)
|
||||
return sum(map((lambda x: x.stat(follow_symlinks=False).st_size), scantree(start_path)))
|
||||
try:
|
||||
return sum(map((lambda x: x.stat(follow_symlinks=False).st_size), scantree(start_path)))
|
||||
except OSError:
|
||||
return 0
|
||||
|
||||
|
||||
def remove_article(text=''):
|
||||
|
|
Loading…
Reference in a new issue