mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 02:30:44 -06:00
feat: hide stacktraces
This commit is contained in:
parent
6700178d68
commit
976f9fc0fa
1 changed files with 13 additions and 2 deletions
|
@ -2173,9 +2173,20 @@ class Cli:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _no_traceback_excepthook(exc_type, exc_val, traceback):
|
||||||
|
# https://stackoverflow.com/questions/7073268/remove-traceback-in-python-on-ctrl-c
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
viv = Viv()
|
try:
|
||||||
Cli(viv).run()
|
viv = Viv()
|
||||||
|
Cli(viv).run()
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
echo(f"caught {a.bold}SIGINT")
|
||||||
|
if sys.excepthook is sys.__excepthook__:
|
||||||
|
sys.excepthook = _no_traceback_excepthook
|
||||||
|
raise
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue