main.py 文件源码

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

项目:EMFT 作者: 132nd-etcher 项目源码 文件源码
def check_cert():
    """
    Checks availability of "cacert.pem" file installed by the certifi module
    """
    LOGGER.info('certificate: checking')
    import certifi
    from emft.core.path import Path
    cacert = str(Path(certifi.where()).abspath())
    if not os.path.exists(cacert):
        raise FileNotFoundError(cacert)
    # # noinspection SpellCheckingInspection
    # if not cacert.crc32() == 'D069EE01':
    #     raise ImportError('cacert.pem file is corrupted: {}'.format(cacert.crc32()))
    LOGGER.debug('setting up local cacert file to: {}'.format(cacert))
    os.environ['REQUESTS_CA_BUNDLE'] = cacert
    LOGGER.info('certificate: checked')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号