Skip to content

Commit ac6e957

Browse files
authored
fix(cli): don't show a stack trace when command + c of the CLI (#2390)
1 parent 66ddfee commit ac6e957

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

playwright/__main__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@
1919

2020

2121
def main() -> None:
22-
driver_executable, driver_cli = compute_driver_executable()
23-
completed_process = subprocess.run(
24-
[driver_executable, driver_cli, *sys.argv[1:]], env=get_driver_env()
25-
)
26-
sys.exit(completed_process.returncode)
22+
try:
23+
driver_executable, driver_cli = compute_driver_executable()
24+
completed_process = subprocess.run(
25+
[driver_executable, driver_cli, *sys.argv[1:]], env=get_driver_env()
26+
)
27+
sys.exit(completed_process.returncode)
28+
except KeyboardInterrupt:
29+
sys.exit(130)
2730

2831

2932
if __name__ == "__main__":

0 commit comments

Comments
 (0)