mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Use "with suppress()" to suppress a python exception
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
from contextlib import suppress
|
||||
|
||||
from kitty.cli import parse_args
|
||||
|
||||
@@ -30,9 +31,8 @@ def real_main(args):
|
||||
|
||||
def main(args):
|
||||
try:
|
||||
real_main(args)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
with suppress(KeyboardInterrupt):
|
||||
real_main(args)
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
Reference in New Issue
Block a user