Too broad exceptions.

* Use .get() with default value instead.
This commit is contained in:
Labrys 2016-06-05 13:35:46 -04:00
commit df8c6bc20f
4 changed files with 37 additions and 129 deletions

View file

@ -740,14 +740,8 @@ def cleanDir(path, section, subsection):
logger.info('Doing Forceful Clean of {0}'.format(path), 'CLEANDIR')
rmDir(path)
return
try:
minSize = int(core.CFG[section][subsection]['minSize'])
except:
minSize = 0
try:
delete_ignored = int(core.CFG[section][subsection]['delete_ignored'])
except:
delete_ignored = 0
minSize = int(core.CFG[section][subsection].get('minSize', 0))
delete_ignored = int(core.CFG[section][subsection].get('delete_ignored', 0))
try:
num_files = len(listMediaFiles(path, minSize=minSize, delete_ignored=delete_ignored))
except: