pdb.py 文件源码

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

项目:pdb 作者: antocuni 项目源码 文件源码
def _init_pygments(self):
        if not self.config.use_pygments:
            return False
        try:
            from pygments.lexers import PythonLexer
            from pygments.formatters import TerminalFormatter, Terminal256Formatter
        except ImportError:
            return False

        if hasattr(self, '_fmt'):
            return True
        if hasattr(self.config, 'formatter'):
            self._fmt = self.config.formatter
        else:
            Formatter = (Terminal256Formatter
                         if self.config.use_terminal256formatter
                            and '256color' in os.environ.get('TERM', '')
                         else TerminalFormatter)
            self._fmt = Formatter(bg=self.config.bg,
                                  colorscheme=self.config.colorscheme)
        self._lexer = PythonLexer()
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号