mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-03-26 21:33:12 +00:00
Clean up other Python files (#11379)
* Address issues found by ruff check. * Make mypy happy; remove some Python 2 compat code. * Also declare port1.
This commit is contained in:
@@ -10,15 +10,11 @@ import sys
|
||||
root_dir = sys.argv[1]
|
||||
port = int(sys.argv[2])
|
||||
|
||||
try:
|
||||
from BaseHTTPServer import HTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
except ModuleNotFoundError:
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
|
||||
httpd = HTTPServer(("localhost", port), SimpleHTTPRequestHandler)
|
||||
try:
|
||||
httpd.socket = ssl.wrap_socket(
|
||||
httpd.socket = ssl.wrap_socket( # type: ignore[attr-defined]
|
||||
httpd.socket,
|
||||
server_side=True,
|
||||
certfile=os.path.join(root_dir, "cert.pem"),
|
||||
|
||||
Reference in New Issue
Block a user