qdb.py 文件源码

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

项目:true_review_web2py 作者: lucadealfaro 项目源码 文件源码
def _runscript(self, filename):
        # The script has to run in __main__ namespace (clear it)
        import __main__
        import imp
        __main__.__dict__.clear()
        __main__.__dict__.update({"__name__": "__main__",
                                  "__file__": filename,
                                  "__builtins__": __builtins__,
                                  "imp": imp,          # need for run
                                  })

        # avoid stopping before we reach the main script
        self._wait_for_mainpyfile = 1
        self.mainpyfile = self.canonic(filename)
        self._user_requested_quit = 0
        statement = 'imp.load_source("__main__", "%s")' % filename
        # notify and wait frontend to set initial params and breakpoints
        self.pipe.send({'method': 'startup', 'args': (__version__, )})
        while self.pull_actions() is not None:
            pass
        self.run(statement)

    # General interaction function
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号