From 6723d55561657e725f63ab050d27e742194b262d Mon Sep 17 00:00:00 2001 From: Trim21 Date: Mon, 22 Apr 2024 21:56:16 +0800 Subject: [PATCH] fix: windows exit code with python ... --- maturin/__main__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/maturin/__main__.py b/maturin/__main__.py index db5e84fb1..61250910a 100644 --- a/maturin/__main__.py +++ b/maturin/__main__.py @@ -41,4 +41,10 @@ def script_exists(dir: str) -> bool: print("Unable to find `maturin` script") exit(1) - os.execv(maturin, [str(maturin)] + sys.argv[1:]) + if sys.platform == "win32": + import subprocess + + code = subprocess.call([str(maturin)] + sys.argv[1:]) + sys.exit(code) + else: + os.execv(maturin, [str(maturin)] + sys.argv[1:])