Skip to content

Commit 215acb6

Browse files
committed
fix E721 violations (do not compare types using 'is')
1 parent fc6cfae commit 215acb6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ably/util/crypto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def get_default_params(params=None):
153153
if not key:
154154
raise ValueError("Crypto.get_default_params: a key is required")
155155

156-
if type(key) == str:
156+
if isinstance(key, str):
157157
key = base64.b64decode(key)
158158

159159
cipher_params = CipherParams(algorithm=algorithm, secret_key=key, iv=iv, mode=mode)

test/ably/rest/restchannelpublish_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ async def check_data():
423423
async def check_history():
424424
history = await channel.history()
425425
message = history.items[0]
426-
return message.data == expected_value and type(message.data) == type_mapping[expected_type]
426+
return message.data == expected_value and isinstance(message.data, type_mapping[expected_type])
427427

428428
await assert_waiter(check_history)
429429

0 commit comments

Comments
 (0)