Fix pep8 E712 comparison to False should be 'if cond is False:' or 'if not cond:'

pull/1093/head
Lee Clemens 2015-06-26 12:14:11 -04:00
parent fe5e7a023e
commit 31b34950f7
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ class Actions(JailThread, Mapping):
True if an IP address get banned.
"""
ticket = self._jail.getFailTicket()
if ticket != False:
if ticket:
aInfo = CallingMap()
bTicket = BanManager.createBanTicket(ticket)
ip = bTicket.getIP()

View File

@ -100,7 +100,7 @@ class AddFailure(unittest.TestCase):
self.assertEqual(
ticket_repr,
'FailTicket: ip=193.168.0.128 time=1167605999.0 #attempts=5 matches=[]')
self.assertFalse(ticket == False)
self.assertFalse(not ticket)
# and some get/set-ers otherwise not tested
ticket.setTime(1000002000.0)
self.assertEqual(ticket.getTime(), 1000002000.0)