python类ResolutionError()的实例源码

ssl_support.py 文件源码 项目:flask_system 作者: prashasy 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        import certifi
        return certifi.where()
    except (ImportError, ResolutionError, ExtractionError):
        return None
setup.py 文件源码 项目:jwalk 作者: jwplayer 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def is_installed(requirement):
    try:
        pkg_resources.require(requirement)
    except pkg_resources.ResolutionError:
        return False
    else:
        return True
ssl_support.py 文件源码 项目:news-for-good 作者: thecodinghub 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def _certifi_where():
    try:
        return __import__('certifi').where()
    except (ImportError, ResolutionError, ExtractionError):
        pass
ssl_support.py 文件源码 项目:CaScale 作者: Thatsillogical 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def _certifi_where():
    try:
        return __import__('certifi').where()
    except (ImportError, ResolutionError, ExtractionError):
        pass
ssl_support.py 文件源码 项目:chihu 作者: yelongyu 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name=='nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:ShelbySearch 作者: Agentscreech 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        import certifi
        return certifi.where()
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:where2live 作者: fbessez 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def _certifi_where():
    try:
        return __import__('certifi').where()
    except (ImportError, ResolutionError, ExtractionError):
        pass
ssl_support.py 文件源码 项目:pyetje 作者: rorlika 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:respeaker_virtualenv 作者: respeaker 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        import certifi
        return certifi.where()
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:Tencent_Cartoon_Download 作者: Fretice 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def _certifi_where():
    try:
        return __import__('certifi').where()
    except (ImportError, ResolutionError, ExtractionError):
        pass
ssl_support.py 文件源码 项目:Problematica-public 作者: TechMaz 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:bawk 作者: jttwnsnd 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:infinite-lorem-ipsum 作者: patjm1992 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        import certifi
        return certifi.where()
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:coolrelation 作者: mrtial 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def _certifi_where():
    try:
        return __import__('certifi').where()
    except (ImportError, ResolutionError, ExtractionError):
        pass
ssl_support.py 文件源码 项目:Price-Comparator 作者: Thejas-1 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name=='nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:fieldsight-kobocat 作者: awemulya 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
config_utils.py 文件源码 项目:bigchaindb 作者: bigchaindb 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def load_consensus_plugin(name=None):
    """Find and load the chosen consensus plugin.

    Args:
        name (string): the name of the entry_point, as advertised in the
            setup.py of the providing package.

    Returns:
        an uninstantiated subclass of ``bigchaindb.consensus.AbstractConsensusRules``
    """
    if not name:
        return BaseConsensusRules

    # TODO: This will return the first plugin with group `bigchaindb.consensus`
    #       and name `name` in the active WorkingSet.
    #       We should probably support Requirements specs in the config, e.g.
    #       consensus_plugin: 'my-plugin-package==0.0.1;default'
    plugin = None
    for entry_point in iter_entry_points('bigchaindb.consensus', name):
        plugin = entry_point.load()

    # No matching entry_point found
    if not plugin:
        raise ResolutionError(
            'No plugin found in group `bigchaindb.consensus` with name `{}`'.
            format(name))

    # Is this strictness desireable?
    # It will probably reduce developer headaches in the wild.
    if not issubclass(plugin, (BaseConsensusRules,)):
        raise TypeError('object of type "{}" does not implement `bigchaindb.'
                        'consensus.BaseConsensusRules`'.format(type(plugin)))

    return plugin
ssl_support.py 文件源码 项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name=='nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        return pkg_resources.resource_filename('certifi', 'cacert.pem')
    except (ImportError, ResolutionError, ExtractionError):
        return None
ssl_support.py 文件源码 项目:python-group-proj 作者: Sharcee 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def _certifi_where():
    try:
        return __import__('certifi').where()
    except (ImportError, ResolutionError, ExtractionError):
        pass
ssl_support.py 文件源码 项目:covar_me_app 作者: CovarMe 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def find_ca_bundle():
    """Return an existing CA bundle path, or None"""
    if os.name == 'nt':
        return get_win_certfile()
    else:
        for cert_path in cert_paths:
            if os.path.isfile(cert_path):
                return cert_path
    try:
        import certifi
        return certifi.where()
    except (ImportError, ResolutionError, ExtractionError):
        return None


问题


面经


文章

微信
公众号

扫码关注公众号