Replace OSError aliases with OSError (#33655)

This commit is contained in:
Franck Nijhof 2020-04-04 22:09:11 +02:00 committed by GitHub
parent 03cae17992
commit 6f1900c6f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 35 additions and 42 deletions

View file

@ -1,7 +1,6 @@
"""Support for Osram Lightify."""
import logging
import random
import socket
from lightify import Lightify
import voluptuous as vol
@ -74,7 +73,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
host = config[CONF_HOST]
try:
bridge = Lightify(host, log_level=logging.NOTSET)
except socket.error as err:
except OSError as err:
msg = "Error connecting to bridge: {} due to: {}".format(host, str(err))
_LOGGER.exception(msg)
return