Remove unused None from dict.get()
Since the default value is None when can't get a key from a dict, So there is no need to use dict.get('key', None). Change-Id: If22a4a6dbfd010a0b9574b42c23ba19a2c54dd6d
This commit is contained in:
parent
120b24295d
commit
277daaf094
|
@ -24,11 +24,11 @@ def get_url(bid):
|
|||
# later though.
|
||||
from bandit.core import extension_loader
|
||||
|
||||
info = extension_loader.MANAGER.plugins_by_id.get(bid, None)
|
||||
info = extension_loader.MANAGER.plugins_by_id.get(bid)
|
||||
if info is not None:
|
||||
return BASE_URL + ('plugins/%s.html' % info.plugin.__name__)
|
||||
|
||||
info = extension_loader.MANAGER.blacklist_by_id.get(bid, None)
|
||||
info = extension_loader.MANAGER.blacklist_by_id.get(bid)
|
||||
if info is not None:
|
||||
template = 'blacklists/blacklist_{kind}.html#{id}-{name}'
|
||||
info['name'] = info['name'].replace('_', '-')
|
||||
|
|
|
@ -105,7 +105,7 @@ class FunctionalTests(testtools.TestCase):
|
|||
for rank in C.RANKING:
|
||||
label = '{0}.{1}'.format(criteria, rank)
|
||||
expected = 0
|
||||
if expect['issues'].get(criteria, None).get(rank, None):
|
||||
if expect['issues'].get(criteria).get(rank):
|
||||
expected = expect['issues'][criteria][rank]
|
||||
self.assertEqual(expected, m['_totals'][label])
|
||||
|
||||
|
|
Loading…
Reference in New Issue