mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 13:23:18 -07:00
Too broad exceptions.
* Use .get() with default value instead.
This commit is contained in:
parent
1cd073cd52
commit
df8c6bc20f
4 changed files with 37 additions and 129 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue