__init__.py 文件源码

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

项目:SwiftKitten 作者: johncsnyder 项目源码 文件源码
def find_yajl_ctypes(required):
    '''
    Finds and loads yajl shared object of the required major
    version (1, 2, ...) using ctypes.
    '''
    # Importing ``ctypes`` should be in scope of this function to prevent failure
    # of `backends`` package load in a runtime where ``ctypes`` is not available.
    # Example of such environment is Google App Engine (GAE).
    from ctypes import util, cdll

    so_name = util.find_library('yajl')
    if so_name is None:
        raise YAJLImportError('YAJL shared object not found.')
    yajl = cdll.LoadLibrary(so_name)
    require_version(yajl.yajl_version(), required)
    return yajl
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号