From 7bbaa57258c8244cda88642d54d2931129a35986 Mon Sep 17 00:00:00 2001 From: Imani Pelton Date: Fri, 11 Oct 2024 10:55:34 -0400 Subject: [PATCH] fix: rearrange internal checks for pip check --- charmcraft/linters.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charmcraft/linters.py b/charmcraft/linters.py index 9f47c5452..df5f2f8ac 100644 --- a/charmcraft/linters.py +++ b/charmcraft/linters.py @@ -679,13 +679,13 @@ class PipCheck(Linter): def run(self, basedir: pathlib.Path) -> str: """Run pip check.""" - if sys.platform == "win32": - self.text = "Linter does not work on Windows." - return self.Result.NONAPPLICABLE venv_dir = basedir / "venv" if not venv_dir.is_dir(): self.text = "Charm does not contain a Python venv." return self.Result.NONAPPLICABLE + if sys.platform == "win32": + self.text = "Linter does not work on Windows." + return self.Result.NONAPPLICABLE python_exe = venv_dir / "bin" / "python" delete_parent = False if not python_exe.parent.exists():