mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-04 17:00:11 -05:00
Fix python 3 compatibility in server_http.py (#350)
Building osslsigncode fails on systems with older versions of Python 3 due to the server_http.py script, part of the test procedure. This script requires the ThreadingHTTPServer module, introduced in Python version 3.7. A workaround has been implemented to create a ThreadingHTTPServer locally, ensuring backward compatibility with older Python versions.
This commit is contained in:
parent
b2024cee9d
commit
42e9733916
@ -6,7 +6,8 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
|
from http.server import SimpleHTTPRequestHandler, HTTPServer
|
||||||
|
from socketserver import ThreadingMixIn
|
||||||
|
|
||||||
RESULT_PATH = os.getcwd()
|
RESULT_PATH = os.getcwd()
|
||||||
FILES_PATH = os.path.join(RESULT_PATH, "./Testing/files/")
|
FILES_PATH = os.path.join(RESULT_PATH, "./Testing/files/")
|
||||||
@ -27,6 +28,8 @@ OPENSSL_TS = ["openssl", "ts",
|
|||||||
"-queryfile", REQUEST,
|
"-queryfile", REQUEST,
|
||||||
"-out", RESPONS]
|
"-out", RESPONS]
|
||||||
|
|
||||||
|
class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
|
||||||
|
daemon_threads = True
|
||||||
|
|
||||||
class RequestHandler(SimpleHTTPRequestHandler):
|
class RequestHandler(SimpleHTTPRequestHandler):
|
||||||
"""Handle the HTTP POST request that arrive at the server"""
|
"""Handle the HTTP POST request that arrive at the server"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user