fix some '!= None' checks, rewrite as 'is not None'
This commit is contained in:
parent
6b8dd1a645
commit
c2aa3df13f
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user