Fix Python 2.7 errors

This commit is contained in:
Mads Marquart
2020-01-05 20:47:31 +01:00
parent bc1e3edf17
commit 8c367af0ff

View File

@@ -11,7 +11,7 @@ def generate_session_id():
@attr.s(slots=True) @attr.s(slots=True)
class Mqtt: class Mqtt(object):
_state = attr.ib() _state = attr.ib()
_mqtt = attr.ib() _mqtt = attr.ib()
_on_message = attr.ib() _on_message = attr.ib()
@@ -62,7 +62,7 @@ class Mqtt:
OSError, OSError,
paho.mqtt.client.WebsocketConnectionError, paho.mqtt.client.WebsocketConnectionError,
) as e: ) as e:
raise _exception.FBchatException("MQTT connection failed") from e raise _exception.FBchatException("MQTT connection failed")
# Raise error if connecting failed # Raise error if connecting failed
if rc != paho.mqtt.client.MQTT_ERR_SUCCESS: if rc != paho.mqtt.client.MQTT_ERR_SUCCESS: