Use "with suppress()" to suppress a python exception
This commit is contained in:
parent
30cd9b2ae4
commit
5e7fd21c8d
1 changed files with 3 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue