Skip to content

Commit

Permalink
tools: Fix warnings reported by PyLint 2.6.0
Browse files Browse the repository at this point in the history
"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"
  • Loading branch information
fetzerch committed Aug 27, 2020
1 parent 4793df7 commit 5079546
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/weather_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -122,15 +122,15 @@ 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:
self.handle_received(self._port, self._connection.readline())
except serial.serialutil.SerialException as err:
self._connection.close()
self._connection = None
raise IOError(err)
raise IOError from err


class RoomMapping():
Expand Down

0 comments on commit 5079546

Please sign in to comment.