mirror of https://github.com/astral-sh/uv
Elide traceback when `python -m uv` in interrupted with Ctrl-C on Windows (#14715)
Closes https://github.com/astral-sh/uv/issues/14704
This commit is contained in:
parent
70875128be
commit
a186fda2d2
|
|
@ -37,7 +37,12 @@ def _run() -> None:
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
completed_process = subprocess.run([uv, *sys.argv[1:]], env=env)
|
# Avoid emitting a traceback on interrupt
|
||||||
|
try:
|
||||||
|
completed_process = subprocess.run([uv, *sys.argv[1:]], env=env)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
sys.exit(2)
|
||||||
|
|
||||||
sys.exit(completed_process.returncode)
|
sys.exit(completed_process.returncode)
|
||||||
else:
|
else:
|
||||||
os.execvpe(uv, [uv, *sys.argv[1:]], env=env)
|
os.execvpe(uv, [uv, *sys.argv[1:]], env=env)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue