From bc7e2ea82b9fa125c777826646daa9c9c4307caf Mon Sep 17 00:00:00 2001 From: Matt Schwager Date: Mon, 17 Oct 2022 08:33:39 -0600 Subject: [PATCH] Fixes #6801, relay exit code when running script --- src/poetry/console/commands/run.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/poetry/console/commands/run.py b/src/poetry/console/commands/run.py index 6496b45af24..50e1ae118f6 100644 --- a/src/poetry/console/commands/run.py +++ b/src/poetry/console/commands/run.py @@ -58,7 +58,7 @@ def run_script(self, script: str | dict[str, str], args: str) -> int: "import sys; " "from importlib import import_module; " f"sys.argv = {args!r}; {src_in_sys_path}" - f"import_module('{module}').{callable_}()" + f"sys.exit(import_module('{module}').{callable_}())" ] return self.env.execute(*cmd)