mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 04:02:27 +00:00
bugfix: import error in example tests
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import re
|
||||
import os
|
||||
import socket
|
||||
import BaseHTTPServer
|
||||
import SimpleHTTPServer
|
||||
from threading import Thread
|
||||
import ssl
|
||||
|
||||
@@ -11,6 +9,13 @@ import ttfw_idf
|
||||
import random
|
||||
import subprocess
|
||||
|
||||
try:
|
||||
import BaseHTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
except ImportError:
|
||||
import http.server as BaseHTTPServer
|
||||
from http.server import SimpleHTTPRequestHandler
|
||||
|
||||
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
||||
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
||||
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
||||
@@ -85,7 +90,7 @@ def start_https_server(ota_image_dir, server_ip, server_port):
|
||||
key_file_handle.close()
|
||||
|
||||
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port),
|
||||
SimpleHTTPServer.SimpleHTTPRequestHandler)
|
||||
SimpleHTTPRequestHandler)
|
||||
|
||||
httpd.socket = ssl.wrap_socket(httpd.socket,
|
||||
keyfile=key_file,
|
||||
|
Reference in New Issue
Block a user