build_module.py 文件源码

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

项目:cppimport 作者: tbenthompson 项目源码 文件源码
def stdchannel_redirected(stdchannel):
    """
    Redirects stdout or stderr to a StringIO object. As of python 3.4, there is a
    standard library contextmanager for this, but backwards compatibility!
    """
    try:
        s = io.StringIO()
        old = getattr(sys, stdchannel)
        setattr(sys, stdchannel, s)
        yield s
    finally:
        setattr(sys, stdchannel, old)

# Subclass setuptools Extension to add a parameter specifying where the shared
# library should be placed after being compiled
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号