1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-10 23:32:23 +01:00

Bump pylint from 2.5.3 to 2.6.0 (#1262)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
This commit is contained in:
dependabot[bot]
2020-09-16 12:12:40 +02:00
committed by GitHub
parent a401c71d3e
commit e7bd93b4b0
17 changed files with 53 additions and 37 deletions

View File

@@ -89,7 +89,7 @@ def mkdir_p(path):
pass
else:
from esphome.core import EsphomeError
raise EsphomeError(f"Error creating directories {path}: {err}")
raise EsphomeError(f"Error creating directories {path}: {err}") from err
def is_ip_address(host):
@@ -110,13 +110,13 @@ def _resolve_with_zeroconf(host):
try:
zc = Zeroconf()
except Exception:
except Exception as err:
raise EsphomeError("Cannot start mDNS sockets, is this a docker container without "
"host network mode?")
"host network mode?") from err
try:
info = zc.resolve_host(host + '.')
except Exception as err:
raise EsphomeError(f"Error resolving mDNS hostname: {err}")
raise EsphomeError(f"Error resolving mDNS hostname: {err}") from err
finally:
zc.close()
if info is None:
@@ -142,7 +142,7 @@ def resolve_ip_address(host):
except OSError as err:
errs.append(str(err))
raise EsphomeError("Error resolving IP address: {}"
"".format(', '.join(errs)))
"".format(', '.join(errs))) from err
def get_bool_env(var, default=False):
@@ -165,10 +165,10 @@ def read_file(path):
return f_handle.read()
except OSError as err:
from esphome.core import EsphomeError
raise EsphomeError(f"Error reading file {path}: {err}")
raise EsphomeError(f"Error reading file {path}: {err}") from err
except UnicodeDecodeError as err:
from esphome.core import EsphomeError
raise EsphomeError(f"Error reading file {path}: {err}")
raise EsphomeError(f"Error reading file {path}: {err}") from err
def _write_file(path: Union[Path, str], text: Union[str, bytes]):
@@ -205,9 +205,9 @@ def _write_file(path: Union[Path, str], text: Union[str, bytes]):
def write_file(path: Union[Path, str], text: str):
try:
_write_file(path, text)
except OSError:
except OSError as err:
from esphome.core import EsphomeError
raise EsphomeError(f"Could not write file at {path}")
raise EsphomeError(f"Could not write file at {path}") from err
def write_file_if_changed(path: Union[Path, str], text: str):
@@ -230,7 +230,7 @@ def copy_file_if_changed(src, dst):
shutil.copy(src, dst)
except OSError as err:
from esphome.core import EsphomeError
raise EsphomeError(f"Error copying file {src} to {dst}: {err}")
raise EsphomeError(f"Error copying file {src} to {dst}: {err}") from err
def list_starts_with(list_, sub):