python3: wire up more code to polyglot.http_server

This commit is contained in:
Eli Schwartz 2019-03-19 17:08:50 -04:00
parent 8594f52fe8
commit ea6a210e70
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
2 changed files with 5 additions and 5 deletions

View File

@ -8,9 +8,10 @@ __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, shutil, tempfile
import SimpleHTTPServer
import SocketServer
from polyglot.http_server import SimpleHTTPRequestHandler
def run_devel_server():
base = os.path.dirname(os.path.abspath(__file__))
@ -27,7 +28,7 @@ def run_devel_server():
with lopen('cfi-test.pyj', 'rb') as f, lopen('cfi-test.js', 'wb') as js:
js.write(compile_pyj(f.read()).encode('utf-8'))
PORT = 8000
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
Handler = SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
print('Serving CFI test at http://localhost:%d' % PORT)
try:
@ -37,4 +38,3 @@ def run_devel_server():
if __name__ == '__main__':
run_devel_server()

View File

@ -18,9 +18,9 @@ if sys.version_info.major > 2:
file=sys.stderr)
raise SystemExit(1)
import time, BaseHTTPServer, os, sys, re, SocketServer
import time, os, sys, re, SocketServer
from threading import Lock, local
from SimpleHTTPServer import SimpleHTTPRequestHandler
from polyglot.http_server import BaseHTTPServer, SimpleHTTPRequestHandler
# Compiler {{{