From d0ab0382fc2edd9dcfc07aa6d4ffdf654adef451 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eren=20G=C3=B6lge?= Date: Tue, 1 Jun 2021 09:15:32 +0200 Subject: [PATCH] linter fixes --- TTS/bin/distribute.py | 2 +- TTS/utils/manage.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/TTS/bin/distribute.py b/TTS/bin/distribute.py index 0bd27275..ea43f88b 100644 --- a/TTS/bin/distribute.py +++ b/TTS/bin/distribute.py @@ -51,7 +51,7 @@ def main(): my_env["PYTHON_EGG_CACHE"] = "/tmp/tmp{}".format(i) command[-1] = "--rank={}".format(i) stdout = None if i == 0 else open(os.devnull, "w") - p = subprocess.Popen(["python3"] + command, stdout=stdout, env=my_env) + p = subprocess.Popen(["python3"] + command, stdout=stdout, env=my_env) # pylint: disable=consider-using-with processes.append(p) print(command) diff --git a/TTS/utils/manage.py b/TTS/utils/manage.py index 2e3caa81..cf7df7de 100644 --- a/TTS/utils/manage.py +++ b/TTS/utils/manage.py @@ -149,8 +149,8 @@ class ModelManager(object): def _download_zip_file(file_url, output): """Download the github releases""" r = requests.get(file_url) - z = zipfile.ZipFile(io.BytesIO(r.content)) - z.extractall(output) + with zipfile.ZipFile(io.BytesIO(r.content)) as z: + z.extractall(output) for file_path in z.namelist()[1:]: src_path = os.path.join(output, file_path) dst_path = os.path.join(output, os.path.basename(file_path))