1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

use tracebackplus instead of cgitb since cgitb is depricated

This commit is contained in:
Kelly Brazil
2020-07-06 10:41:01 -07:00
parent fbf47d4085
commit 4ee199c02a
2 changed files with 189 additions and 3 deletions

View File

@ -16,7 +16,6 @@ from pygments.style import Style
from pygments.token import (Name, Number, String, Keyword)
from pygments.lexers import JsonLexer
from pygments.formatters import Terminal256Formatter
import jc.utils
import jc.appdirs as appdirs
@ -401,12 +400,13 @@ def main():
except Exception:
if debug:
if verbose_debug:
import cgitb
cgitb.enable(display=1, logdir=None, context=5, format="text")
import jc.tracebackplus
jc.tracebackplus.enable(context=11)
raise
else:
import jc.utils
jc.utils.error_message(
f'{parser_name} parser could not parse the input data. Did you use the correct parser?\n'
' For details use the -d or -dd option.')