straight up: ruff format (#11329)

* straight up: ruff format

* Apply suggestions from code review
This commit is contained in:
Alexei Znamensky
2025-12-28 01:36:24 +13:00
committed by GitHub
parent 04d0a4daf3
commit d549baa5e1
36 changed files with 438 additions and 396 deletions

View File

@@ -16,15 +16,17 @@ try:
except ModuleNotFoundError:
from http.server import HTTPServer, SimpleHTTPRequestHandler
httpd = HTTPServer(('localhost', port), SimpleHTTPRequestHandler)
httpd = HTTPServer(("localhost", port), SimpleHTTPRequestHandler)
try:
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True,
certfile=os.path.join(root_dir, 'cert.pem'),
keyfile=os.path.join(root_dir, 'key.pem'))
httpd.socket = ssl.wrap_socket(
httpd.socket,
server_side=True,
certfile=os.path.join(root_dir, "cert.pem"),
keyfile=os.path.join(root_dir, "key.pem"),
)
except AttributeError:
# Python 3.12 or newer:
context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
context.load_cert_chain(certfile=os.path.join(root_dir, 'cert.pem'),
keyfile=os.path.join(root_dir, 'key.pem'))
context.load_cert_chain(certfile=os.path.join(root_dir, "cert.pem"), keyfile=os.path.join(root_dir, "key.pem"))
httpd.socket = context.wrap_socket(httpd.socket)
httpd.handle_request()