From 2f92f18b7b9bb5199f292e6eb5235835e4e2b006 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Tue, 16 Nov 2021 09:38:35 -0700 Subject: [PATCH] chore: clean up minor code smells This resolves some code smells found during python-poetry/poetry#4773. I have not yet added the new lints to this repo, but I once they're relatively stable/agreed on the main repo I will PR them here. --- install-poetry.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install-poetry.py b/install-poetry.py index 38caf59..079cb68 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -213,7 +213,7 @@ def _get_win_folder_with_ctypes(csidl_name): if WINDOWS: try: - from ctypes import windll # noqa + from ctypes import windll # noqa: F401 _get_win_folder = _get_win_folder_with_ctypes except ImportError: @@ -580,7 +580,7 @@ class Installer: try: self._install_comment(version, "Creating environment") yield VirtualEnvironment.make(env_path) - except Exception as e: # noqa + except Exception as e: if env_path.exists(): self._install_comment( version, "An error occurred. Removing partial environment." @@ -871,7 +871,7 @@ def main(): try: return installer.run() except PoetryInstallationError as e: - installer._write(colorize("error", "Poetry installation failed.")) # noqa + installer._write(colorize("error", "Poetry installation failed.")) if e.log is not None: import traceback @@ -882,7 +882,7 @@ def main(): dir=str(Path.cwd()), text=True, ) - installer._write(colorize("error", f"See {path} for error logs.")) # noqa + installer._write(colorize("error", f"See {path} for error logs.")) text = f"{e.log}\nTraceback:\n\n{''.join(traceback.format_tb(e.__traceback__))}" Path(path).write_text(text)