main.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:eyeD3 作者: nicfit 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号