Skip to content

Commit b76e2f8

Browse files
committed
Fix warnings about "is" operator
1 parent 1906676 commit b76e2f8

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

gradify.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,14 @@ def calculate_spread(spread_quads, col):
110110
# TODO: Make more readable
111111
while 0 in taken_col:
112112
best_col = int(strength_spread.index(max(strength_spread)) / 2)
113-
if max(strength_spread) is 0:
113+
if max(strength_spread) == 0:
114114
best_col = taken_col.index(0)
115-
if taken_col[best_col] is 0:
115+
if taken_col[best_col] == 0:
116116
best_quad = spread_quads[best_col].index(max(spread_quads[best_col]))
117-
if max(spread_quads[best_col]) is 0:
117+
if max(spread_quads[best_col]) == 0:
118118
sys.stderr.write(str(spread_quads))
119119
best_quad = taken_quads.index(0)
120-
if taken_quads[best_quad] is 0:
120+
if taken_quads[best_quad] == 0:
121121
taken_quads[best_quad] = 1
122122
taken_col[best_col] = 1
123123
col[best_col] = list(col[best_col])
@@ -164,7 +164,7 @@ def get_colors(self):
164164
ranked_colors = sorted(image.getcolors(image.size[0] * image.size[1]), key=itemgetter(0))
165165
for i in range(len(ranked_colors)):
166166
colors.append(ranked_colors[len(ranked_colors) - 1 - i])
167-
if self.MAX_COLORS is 1:
167+
if self.MAX_COLORS == 1:
168168
return colors[0]
169169
else:
170170
return self.find_best_colors(colors)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='gradify',
12-
version='0.3.2',
12+
version='0.3.3',
1313
description='A python library to generate CSS gradient from an image',
1414
long_description=README,
1515
url='https://github.com/QueraTeam/gradify',

0 commit comments

Comments
 (0)