From 50795468f8265bf2016f5c926d4532c6d92ef139 Mon Sep 17 00:00:00 2001 From: Christian Fetzer Date: Thu, 27 Aug 2020 07:48:18 +0200 Subject: [PATCH] tools: Fix warnings reported by PyLint 2.6.0 "tools/weather_station.py:105: [W0707(raise-missing-from), UdpReceiverThread.initialize] Consider explicitly re-raising using the 'from' keyword" "tools/weather_station.py:125: [W0707(raise-missing-from), SerialReceiverThread.initialize] Consider explicitly re-raising using the 'from' keyword" "tools/weather_station.py:133: [W0707(raise-missing-from), SerialReceiverThread.receive] Consider explicitly re-raising using the 'from' keyword" --- tools/weather_station.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/weather_station.py b/tools/weather_station.py index 01c1629..79822bf 100755 --- a/tools/weather_station.py +++ b/tools/weather_station.py @@ -102,7 +102,7 @@ def initialize(self): self._connection.settimeout(3) except socket.error as err: self._connection = None - raise IOError(err) + raise IOError from err def receive(self): try: @@ -122,7 +122,7 @@ def initialize(self): try: self._connection = serial.Serial(self._port, 9600, timeout=3) except serial.serialutil.SerialException as err: - raise IOError(err) + raise IOError from err def receive(self): try: @@ -130,7 +130,7 @@ def receive(self): except serial.serialutil.SerialException as err: self._connection.close() self._connection = None - raise IOError(err) + raise IOError from err class RoomMapping():