cli.py 文件源码

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

项目:cligraphy 作者: Netflix-Skunkworks 项目源码 文件源码
def _run_command_process(self, args):
        """Command (child) process entry point. args contains the function to execute and all arguments."""

        setup_logging(args._level)

        command = ' '.join(sys.argv[1:])
        setproctitle('oc/command/%s' % command)
        faulthandler.register(signal.SIGUSR2, all_threads=True, chain=False)  # pylint:disable=no-member
        self._setup_requests_audit_headers(command)

        ret = 1
        try:
            chain = [self._run]
            if args._profile:
                chain.append(profiling_wrapper)
            if args._pdb:
                chain.append(pdb_wrapper)
            ret = call_chain(chain, args)
        except SystemExit as exc:
            ret = exc.code
        except ParserError as pe:
            pe.report()
        except Exception:  # pylint:disable=broad-except
            logging.exception('Top level exception in command process')
        finally:
            sys.exit(ret)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号