本文整理匯總了Python中pip._vendor.urllib3.contrib.securetransport.inject_into_urllib3方法的典型用法代碼示例。如果您正苦於以下問題:Python securetransport.inject_into_urllib3方法的具體用法?Python securetransport.inject_into_urllib3怎麽用?Python securetransport.inject_into_urllib3使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pip._vendor.urllib3.contrib.securetransport
的用法示例。
在下文中一共展示了securetransport.inject_into_urllib3方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: inject_securetransport
# 需要導入模塊: from pip._vendor.urllib3.contrib import securetransport [as 別名]
# 或者: from pip._vendor.urllib3.contrib.securetransport import inject_into_urllib3 [as 別名]
def inject_securetransport():
# type: () -> None
# Only relevant on macOS
if sys.platform != "darwin":
return
try:
import ssl
except ImportError:
return
# Checks for OpenSSL 1.0.1
if ssl.OPENSSL_VERSION_NUMBER >= 0x1000100f:
return
try:
from pip._vendor.urllib3.contrib import securetransport
except (ImportError, OSError):
return
securetransport.inject_into_urllib3()