Use "with suppress()" to suppress a python exception
This commit is contained in:
parent
30cd9b2ae4
commit
5e7fd21c8d
@ -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:
|
||||
with suppress(KeyboardInterrupt):
|
||||
real_main(args)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user