1

我在 python 中使用以下代码发送请求

def get(self, url):
 response = None
 try:
    ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1_1 | ssl.PROTOCOL_TLSv1_2)
    if url.lower().startswith('https'):
        response = ur.urlopen(url, context=ctx)
        return response.read()
    else:
        raise ValueError from None
 except Exception as ex:
    print(str(ex))

使用 bandit 执行代码质量测试时出现错误 在此处输入图像描述

4

0 回答 0