aboutsummaryrefslogtreecommitdiffstats
path: root/src/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripts')
-rwxr-xr-xsrc/scripts/test_cli.py26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/scripts/test_cli.py b/src/scripts/test_cli.py
index 5c51f9083..baeb1d542 100755
--- a/src/scripts/test_cli.py
+++ b/src/scripts/test_cli.py
@@ -619,7 +619,13 @@ def cli_tls_http_server_tests(tmp_dir):
if not check_for_command("tls_http_server"):
return
- from http.client import HTTPSConnection
+ try:
+ from http.client import HTTPSConnection
+ except ImportError:
+ try:
+ from httplib import HTTPSConnection
+ except ImportError:
+ return
import ssl
server_port = random_port_number()
@@ -666,8 +672,22 @@ def cli_tls_proxy_tests(tmp_dir):
if not check_for_command("tls_proxy"):
return
- from http.client import HTTPSConnection
- from http.server import HTTPServer, BaseHTTPRequestHandler
+ try:
+ from http.client import HTTPSConnection
+ except ImportError:
+ try:
+ from httplib import HTTPSConnection
+ except ImportError:
+ return
+
+ try:
+ from httpx.server import HTTPServer, BaseHTTPRequestHandler
+ except ImportError:
+ try:
+ from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+ except ImportError:
+ return
+
import ssl
import threading