Skip to content

Commit

Permalink
Use isinstance instead of type
Browse files Browse the repository at this point in the history
  • Loading branch information
chmielowiec authored and frederikaalund committed Feb 16, 2021
1 parent fe1df16 commit f512fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion asyncio_mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def connect(self, *, timeout=10):
await loop.run_in_executor(None, self._client.connect, self._hostname, self._port, 60)
# paho.mqttClient.socket() return non-None after the call to connect.
client_socket = self._client.socket()
if type(client_socket) is not mqtt.WebsocketWrapper:
if not isinstance(client_socket, mqtt.WebsocketWrapper):
client_socket.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, 2048)
# paho.mqtt.Client.connect may raise one of several exceptions.
# We convert all of them to the common MqttError for user convenience.
Expand Down

0 comments on commit f512fa8

Please sign in to comment.