PEP8: .has_key() is deprecated, use 'in'

This commit is contained in:
labrys 2016-05-31 03:33:50 -04:00 committed by Labrys
commit c5c5279a8b
2 changed files with 4 additions and 4 deletions

View file

@ -189,7 +189,7 @@ class autoProcessMovie(object):
status = 0
elif num_files > 0 and good_files < num_files:
logger.info("Status shown as success from Downloader, but corrupt video files found. Setting as failed.", section)
if os.environ.has_key('NZBOP_VERSION') and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
if 'NZBOP_VERSION' in os.environ and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
print('[NZB] MARK=BAD')
if failureLink:
failureLink = failureLink + '&corrupt=true'
@ -200,7 +200,7 @@ class autoProcessMovie(object):
else:
logger.warning("No media files found in directory %s. Processing this as a failed download" % (dirName), section)
status = 1
if os.environ.has_key('NZBOP_VERSION') and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
if 'NZBOP_VERSION' in os.environ and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
print('[NZB] MARK=BAD')
if status == 0:

View file

@ -169,7 +169,7 @@ class autoProcessTV(object):
logger.info('Found corrupt videos. Setting status Failed')
status = 1
failed = 1
if os.environ.has_key('NZBOP_VERSION') and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
if 'NZBOP_VERSION' in os.environ and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
print('[NZB] MARK=BAD')
if failureLink:
failureLink = failureLink + '&corrupt=true'
@ -190,7 +190,7 @@ class autoProcessTV(object):
logger.warning("No media files found in directory %s. Processing this as a failed download" % (dirName), section)
status = 1
failed = 1
if os.environ.has_key('NZBOP_VERSION') and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
if 'NZBOP_VERSION' in os.environ and os.environ['NZBOP_VERSION'][0:5] >= '14.0':
print('[NZB] MARK=BAD')
if status == 0 and core.TRANSCODE == 1: # only transcode successful downloads