* Upgrade flake8 to 3.5

* Fix flake8 bare except errors

* Make flake8 and pylint cooperate
This commit is contained in:
Ville Skyttä authored and Paulus Schoutsen committed 2018-01-29 00:23:53 -08:00
1 parent 5426e5c875
commit 78a3c01f27
12 files changed
+15 -21

No files matched your search

@@ -70,8 +70,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
phonebook = FritzBoxPhonebook(
host=host, port=port, username=username, password=password,
phonebook_id=phonebook_id, prefixes=prefixes)
# pylint: disable=bare-except
except:
except: # noqa: E722 # pylint: disable=bare-except
phonebook = None
_LOGGER.warning("Phonebook with ID %s not found on Fritz!Box",
phonebook_id)
+1 -2
View File
@@ -197,7 +197,6 @@ class QNAPStatsAPI(object):
self.data = {}
# pylint: disable=bare-except
@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):
"""Update API information and store locally."""
@@ -207,7 +206,7 @@ class QNAPStatsAPI(object):
self.data["smart_drive_health"] = self._api.get_smart_disk_health()
self.data["volumes"] = self._api.get_volumes()
self.data["bandwidth"] = self._api.get_bandwidth()
except:
except: # noqa: E722 # pylint: disable=bare-except
_LOGGER.exception("Failed to fetch QNAP stats from the NAS")
@@ -136,7 +136,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
class SynoApi(object):
"""Class to interface with Synology DSM API."""
# pylint: disable=bare-except
def __init__(self, host, port, username, password, temp_unit):
"""Initialize the API wrapper class."""
from SynologyDSM import SynologyDSM
@@ -144,7 +143,7 @@ class SynoApi(object):
try:
self._api = SynologyDSM(host, port, username, password)
except:
except: # noqa: E722 # pylint: disable=bare-except
_LOGGER.error("Error setting up Synology DSM")
# Will be updated when update() gets called.