def _main():
"""Entry point"""
try:
args, _, config = parseCommandLine()
eyed3.utils.console.AnsiCodes.init(not args.no_color)
mainFunc = main if args.debug_profile is False else profileMain
retval = mainFunc(args, config)
except KeyboardInterrupt:
retval = 0
except (StopIteration, IOError) as ex:
eyed3.utils.console.printError(UnicodeType(ex))
retval = 1
except Exception as ex:
eyed3.utils.console.printError("Uncaught exception: %s\n" % str(ex))
eyed3.log.exception(ex)
retval = 1
if args.debug_pdb:
try:
with warnings.catch_warnings():
warnings.simplefilter("ignore", PendingDeprecationWarning)
# Must delay the import of ipdb as say as possible because
# of https://github.com/gotcha/ipdb/issues/48
import ipdb as pdb
except ImportError:
import pdb
e, m, tb = sys.exc_info()
pdb.post_mortem(tb)
sys.exit(retval)
评论列表
文章目录