Fix recently introduced warning. (#11257)
[mono-project.git] / sdks / wasm / server.py
blob463239d8ad8b5c3bf10ce47ab3b37f67841fbc7b
1 import sys
3 if sys.version_info[0] == 2:
5 import SimpleHTTPServer
6 import SocketServer
8 PORT = 8000
10 class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
11 pass
13 Handler.extensions_map['.wasm'] = 'application/wasm'
15 httpd = SocketServer.TCPServer(("", PORT), Handler)
17 print ("python 2 serving at port", PORT)
18 httpd.serve_forever()
21 if sys.version_info[0] == 3:
23 import http.server
24 import socketserver
26 PORT = 8000
28 Handler = http.server.SimpleHTTPRequestHandler
29 Handler.extensions_map['.wasm'] = 'application/wasm'
31 with socketserver.TCPServer(("", PORT), Handler) as httpd:
32 print("python 3 serving at port", PORT)
33 httpd.serve_forever()