Python requests.packages.urllib3.exceptions 模块,InsecurePlatformWarning() 实例源码

我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用requests.packages.urllib3.exceptions.InsecurePlatformWarning()

项目:jscanner    作者:tampe125    | 项目源码 | 文件源码
def checkenv(self):
        try:
            import requests.packages.urllib3
        except ImportError:
            raise Exception('requests package not installed. Run pip install -r requirements.txt and try again.')

        # Disable warnings about SSL connections
        try:
            from requests.packages.urllib3.exceptions import InsecureRequestWarning
            requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
        except ImportError:
            pass

        try:
            from requests.packages.urllib3.exceptions import InsecurePlatformWarning
            requests.packages.urllib3.disable_warnings(InsecurePlatformWarning)
        except ImportError:
            pass
项目:AmazonRobot    作者:WuLC    | 项目源码 | 文件源码
def ignore_warnings():
    requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
    requests.packages.urllib3.disable_warnings(SubjectAltNameWarning)
    requests.packages.urllib3.disable_warnings(InsecurePlatformWarning)
    requests.packages.urllib3.disable_warnings(SNIMissingWarning)