Code styling tweaks to core utils & YAML loader (#85433)

Code styling tweaks to core utils
This commit is contained in:
Franck Nijhof
2023-01-09 07:01:55 +01:00
committed by GitHub
parent aa1c539683
commit 7adb8d5ddc
11 changed files with 68 additions and 51 deletions

View File

@@ -8,12 +8,12 @@ import certifi
def client_context() -> ssl.SSLContext:
"""Return an SSL context for making requests."""
# Reuse environment variable definition from requests, since it's already a requirement
# If the environment variable has no value, fall back to using certs from certifi package
# Reuse environment variable definition from requests, since it's already a
# requirement. If the environment variable has no value, fall back to using
# certs from certifi package.
cafile = environ.get("REQUESTS_CA_BUNDLE", certifi.where())
context = ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=cafile)
return context
return ssl.create_default_context(purpose=ssl.Purpose.SERVER_AUTH, cafile=cafile)
def server_context_modern() -> ssl.SSLContext: