Clean up redudant exceptions from handlers (#51741)

This commit is contained in:
Franck Nijhof 2021-06-11 13:29:50 +02:00 committed by GitHub
parent b4aeddd12f
commit f17a5f0db9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 16 additions and 20 deletions

View file

@ -112,7 +112,7 @@ class PioneerDevice(MediaPlayerEntity):
try:
try:
telnet = telnetlib.Telnet(self._host, self._port, self._timeout)
except (ConnectionRefusedError, OSError):
except OSError:
_LOGGER.warning("Pioneer %s refused connection", self._name)
return
telnet.write(command.encode("ASCII") + b"\r")
@ -125,7 +125,7 @@ class PioneerDevice(MediaPlayerEntity):
"""Get the latest details from the device."""
try:
telnet = telnetlib.Telnet(self._host, self._port, self._timeout)
except (ConnectionRefusedError, OSError):
except OSError:
_LOGGER.warning("Pioneer %s refused connection", self._name)
return False