example_test.py: Update OTA example tests to make it compatible with python3

This commit is contained in:
Shubham Kulkarni
2020-05-14 12:09:29 +05:30
committed by bot
parent b8f5d2e466
commit c287ca1363
3 changed files with 13 additions and 20 deletions

View File

@@ -1,8 +1,7 @@
import re
import os
import socket
import BaseHTTPServer
import SimpleHTTPServer
import http.server
from threading import Thread
import ssl
@@ -86,8 +85,7 @@ def start_https_server(ota_image_dir, server_ip, server_port):
key_file_handle.write(server_key)
key_file_handle.close()
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port),
SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd = http.server.HTTPServer((server_ip, server_port), http.server.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket(httpd.socket,
keyfile=key_file,