fix some '!= None' checks, rewrite as 'is not None'

This commit is contained in:
Brian S. Stephan 2019-06-29 09:23:02 -05:00
parent 6b8dd1a645
commit c2aa3df13f
1 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ class DiceRoller(object):
output = ""
repeat = 1
if trials != None:
if trials is not None:
repeat = trials
for i in range(repeat):
mode = 1
@ -86,8 +86,8 @@ class DiceRoller(object):
# m[0] = (keep, num dice)
# m[1] = num faces on the die
if type(m) == tuple:
if m[0] != None:
if m[0][0] != None:
if m[0] is not None:
if m[0][0] is not None:
keep = m[0][0]
dice = m[0][1]
size = m[1]
@ -113,14 +113,14 @@ class DiceRoller(object):
curr_str += str(m)
total += mode * res
if repeat == 1:
if comment != None:
if comment is not None:
output = "%d %s (%s)" % (total, comment.strip(), curr_str)
else:
output = "%d (%s)" % (total, curr_str)
else:
output += "%d (%s)" % (total, curr_str)
if i == repeat - 1:
if comment != None:
if comment is not None:
output += " (%s)" % (comment.strip())
return output