runtest.py 文件源码

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

项目:maas 作者: maas 项目源码 文件源码
def _captureThreadStacks(self):
        """Capture the stacks for all currently running threads.

        :return: A list of ``(thread-description, stack)`` tuples. See
            `traceback.format_stack` for the format of ``stack``.
        """
        threads = {t.ident: t for t in threading.enumerate()}

        def describe(ident):
            if ident in threads:
                return repr(threads[ident])
            else:
                return "<*Unknown* %d>" % ident

        return [
            (describe(ident), traceback.format_stack(frame))
            for ident, frame in sys._current_frames().items()
        ]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号