mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-22 11:34:09 +00:00
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
1 changed files with 6 additions and 1 deletions
|
@ -37,7 +37,12 @@ def _run() -> None:
|
|||
if sys.platform == "win32":
|
||||
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)
|
||||
else:
|
||||
os.execvpe(uv, [uv, *sys.argv[1:]], env=env)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue