本文整理匯總了Python中pkg_resources.ExtractionError方法的典型用法代碼示例。如果您正苦於以下問題:Python pkg_resources.ExtractionError方法的具體用法?Python pkg_resources.ExtractionError怎麽用?Python pkg_resources.ExtractionError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pkg_resources
的用法示例。
在下文中一共展示了pkg_resources.ExtractionError方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: find_ca_bundle
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import ExtractionError [as 別名]
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
示例2: _certifi_where
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import ExtractionError [as 別名]
def _certifi_where():
try:
return __import__('certifi').where()
except (ImportError, ResolutionError, ExtractionError):
pass
示例3: find_ca_bundle
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import ExtractionError [as 別名]
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
示例4: find_ca_bundle
# 需要導入模塊: import pkg_resources [as 別名]
# 或者: from pkg_resources import ExtractionError [as 別名]
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