Skip to content

Commit 6cdd7c5

Browse files
Fix MQTT connection argument validation (#513)
* Fix MQTT connection argument validation assert "some string" will never raise an exception * update error type --------- Co-authored-by: Pascal Brogle <[email protected]>
1 parent 30d6fb2 commit 6cdd7c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

awsiot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, mqtt_connection: mqtt.Connection or mqtt5.Client):
3939
self._mqtt_connection = mqtt_connection.new_connection()
4040
self._mqtt5_client = mqtt_connection
4141
else:
42-
assert("The service client could only take mqtt.Connection and mqtt5.Client as argument")
42+
raise TypeError("The service client could only take mqtt.Connection and mqtt5.Client as argument")
4343

4444
@property
4545
def mqtt_connection(self) -> mqtt.Connection:

0 commit comments

Comments
 (0)