From e8d8f76750e1abaebd628e2323a49163d102c9d6 Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Fri, 16 Sep 2022 12:15:24 -0600 Subject: [PATCH] fix: check that sys.executable is valid before env creation --- install-poetry.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install-poetry.py b/install-poetry.py index 74dd7d4..b6d32d4 100644 --- a/install-poetry.py +++ b/install-poetry.py @@ -293,6 +293,11 @@ class VirtualEnvironment: @classmethod def make(cls, target: Path) -> "VirtualEnvironment": + if not sys.executable: + raise ValueError( + "Unable to determine sys.executable. Set PATH to a sane value or set it explicitly with PYTHONEXECUTABLE." + ) + try: # on some linux distributions (eg: debian), the distribution provided python # installation might not include ensurepip, causing the venv module to