Skip to content

Commit e4ea5be

Browse files
committed
Fix SyntaxWarnings when comparing a literal with 'is' instead of '=='
1 parent 7963f57 commit e4ea5be

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

message_media_messages/api_helper.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ def serialize_array(key, array, formatting="indexed"):
124124
serializable_types = (str, int, float, bool, datetime.date, APIHelper.CustomDate)
125125

126126
if isinstance(array[0], serializable_types):
127-
if formatting is "unindexed":
127+
if formatting == "unindexed":
128128
tuples += [("{0}[]".format(key), element) for element in array]
129-
elif formatting is "indexed":
129+
elif formatting == "indexed":
130130
tuples += [("{0}[{1}]".format(key, index), element) for index, element in enumerate(array)]
131-
elif formatting is "plain":
131+
elif formatting == "plain":
132132
tuples += [(key, element) for element in array]
133133
else:
134134
raise ValueError("Invalid format provided.")
@@ -199,13 +199,13 @@ def append_url_with_query_parameters(url,
199199
if value is not None:
200200
if isinstance(value, list):
201201
value = [element for element in value if element]
202-
if array_serialization is "csv":
202+
if array_serialization == "csv":
203203
url += "{0}{1}={2}".format(seperator, key,
204204
",".join(quote(str(x), safe='') for x in value))
205-
elif array_serialization is "psv":
205+
elif array_serialization == "psv":
206206
url += "{0}{1}={2}".format(seperator, key,
207207
"|".join(quote(str(x), safe='') for x in value))
208-
elif array_serialization is "tsv":
208+
elif array_serialization == "tsv":
209209
url += "{0}{1}={2}".format(seperator, key,
210210
"\t".join(quote(str(x), safe='') for x in value))
211211
else:

0 commit comments

Comments
 (0)