Skip to content

Commit ddb0b21

Browse files
authored
Fix Pylint Error
Since this is an explicit error, I don't think there is any additional context https://docs.python.org/3/library/exceptions.html
1 parent 1facbec commit ddb0b21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_minimqtt/adafruit_minimqtt.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ def remove_topic_callback(self, mqtt_topic):
246246
try:
247247
del self._on_message_filtered[mqtt_topic]
248248
except KeyError:
249-
raise from KeyError("MQTT topic callback not added with add_topic_callback.")
249+
raise KeyError("MQTT topic callback not added with add_topic_callback.") from None
250250

251251
@property
252252
def on_message(self):
@@ -287,7 +287,7 @@ def connect(self, clean_session=True):
287287
conntype = _the_interface.TLS_MODE
288288
self._sock.connect((self.broker, self.port), conntype)
289289
except RuntimeError as e:
290-
raise from MMQTTException("Invalid broker address defined.", e)
290+
raise MMQTTException("Invalid broker address defined.", e) from None
291291
else:
292292
try:
293293
if self.logger is not None:
@@ -299,7 +299,7 @@ def connect(self, clean_session=True):
299299
)[0]
300300
self._sock.connect(addr[-1], _the_interface.TCP_MODE)
301301
except RuntimeError as e:
302-
raise from MMQTTException("Invalid broker address defined.", e)
302+
raise MMQTTException("Invalid broker address defined.", e) from None
303303

304304
# Fixed Header
305305
fixed_header = bytearray([0x10])

0 commit comments

Comments
 (0)