test_cffi_binary.py 文件源码

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

项目:SwiftKitten 作者: johncsnyder 项目源码 文件源码
def test_no_unknown_exported_symbols():
    if not hasattr(_cffi_backend, '__file__'):
        py.test.skip("_cffi_backend module is built-in")
    if not sys.platform.startswith('linux'):
        py.test.skip("linux-only")
    g = os.popen("objdump -T '%s'" % _cffi_backend.__file__, 'r')
    for line in g:
        if not line.startswith('0'):
            continue
        if '*UND*' in line:
            continue
        name = line.split()[-1]
        if name.startswith('_') or name.startswith('.'):
            continue
        if name not in ('init_cffi_backend', 'PyInit__cffi_backend'):
            raise Exception("Unexpected exported name %r" % (name,))
    g.close()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号