pdb.py 文件源码

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

项目:pdb 作者: antocuni 项目源码 文件源码
def do_debug(self, arg):
        # this is a hack (as usual :-))
        #
        # inside the original do_debug, there is a call to the global "Pdb" to
        # instantiate the recursive debugger: we want to intercept this call
        # and instantiate *our* Pdb, passing our custom config. Therefore we
        # dynamically rebind the globals.
        #
        def new_pdb_with_config(*args):
            kwds = dict(Config=self.ConfigFactory)
            return self.__class__(*args, **kwds)
        newglobals = {
            'Pdb': new_pdb_with_config,
            'sys': sys,
            }
        if sys.version_info < (3, ):
            do_debug_func = pdb.Pdb.do_debug.im_func
        else:
            do_debug_func = pdb.Pdb.do_debug

        orig_do_debug = rebind_globals(do_debug_func, newglobals)
        return orig_do_debug(self, arg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号