test_runpy.py 文件源码

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

项目:ouroboros 作者: pybee 项目源码 文件源码
def _fix_ns_for_legacy_pyc(self, ns, alter_sys):
        char_to_add = "c" if __debug__ else "o"
        ns["__file__"] += char_to_add
        ns["__cached__"] = ns["__file__"]
        spec = ns["__spec__"]
        new_spec = importlib.util.spec_from_file_location(spec.name,
                                                          ns["__file__"])
        ns["__spec__"] = new_spec
        if alter_sys:
            ns["run_argv0"] += char_to_add
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号