diff --git a/experimental/skottiekit/Makefile b/experimental/skottiekit/Makefile index cf98418c7af8..5eb22a5343bd 100644 --- a/experimental/skottiekit/Makefile +++ b/experimental/skottiekit/Makefile @@ -45,4 +45,4 @@ clean_npm: serve: echo "Go check out http://localhost:8001/" - cd examples && python ../serve.py + cd examples && python3 ../serve.py diff --git a/experimental/skottiekit/serve.py b/experimental/skottiekit/serve.py index 878d48dce408..a3e1f2687771 100644 --- a/experimental/skottiekit/serve.py +++ b/experimental/skottiekit/serve.py @@ -1,20 +1,21 @@ -# Copyright 2020 Google LLC - +#!/usr/bin/env python3 +# Copyright 2018 Google LLC +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver -PORT = 8001 +PORT = 8000 -class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): +class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.js'] = 'application/javascript' # Without the correct MIME type, async compilation doesn't work Handler.extensions_map['.wasm'] = 'application/wasm' -httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd = socketserver.TCPServer(("", PORT), Handler) httpd.serve_forever() diff --git a/experimental/tskit/Makefile b/experimental/tskit/Makefile index d5641c8baaf8..6eec614a1535 100644 --- a/experimental/tskit/Makefile +++ b/experimental/tskit/Makefile @@ -16,7 +16,7 @@ release: serve: echo "Go check out http://localhost:8000/npm_build/example.html" - python2 serve.py + python3 serve.py lint: npx eslint . --ext .ts diff --git a/experimental/tskit/serve.py b/experimental/tskit/serve.py index 8c6541f1fb1f..a3e1f2687771 100644 --- a/experimental/tskit/serve.py +++ b/experimental/tskit/serve.py @@ -1,20 +1,21 @@ +#!/usr/bin/env python3 # Copyright 2018 Google LLC - +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver PORT = 8000 -class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): +class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.js'] = 'application/javascript' # Without the correct MIME type, async compilation doesn't work Handler.extensions_map['.wasm'] = 'application/wasm' -httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd = socketserver.TCPServer(("", PORT), Handler) httpd.serve_forever() diff --git a/experimental/wasm-skp-debugger/serve.py b/experimental/wasm-skp-debugger/serve.py index 8c6541f1fb1f..a3e1f2687771 100644 --- a/experimental/wasm-skp-debugger/serve.py +++ b/experimental/wasm-skp-debugger/serve.py @@ -1,20 +1,21 @@ +#!/usr/bin/env python3 # Copyright 2018 Google LLC - +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver PORT = 8000 -class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): +class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.js'] = 'application/javascript' # Without the correct MIME type, async compilation doesn't work Handler.extensions_map['.wasm'] = 'application/wasm' -httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd = socketserver.TCPServer(("", PORT), Handler) httpd.serve_forever() diff --git a/modules/canvaskit/Makefile b/modules/canvaskit/Makefile index bdb150683427..1019f967ea37 100644 --- a/modules/canvaskit/Makefile +++ b/modules/canvaskit/Makefile @@ -98,7 +98,7 @@ local-example: mkdir -p node_modules ln -s ../npm_build node_modules/canvaskit echo "Go check out http://localhost:8000/npm_build/example.html" - python2 serve.py + python3 serve.py test-continuous: echo "Assuming npm ci has been run by user" diff --git a/modules/canvaskit/serve.py b/modules/canvaskit/serve.py index 8c6541f1fb1f..a3e1f2687771 100644 --- a/modules/canvaskit/serve.py +++ b/modules/canvaskit/serve.py @@ -1,20 +1,21 @@ +#!/usr/bin/env python3 # Copyright 2018 Google LLC - +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver PORT = 8000 -class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): +class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.js'] = 'application/javascript' # Without the correct MIME type, async compilation doesn't work Handler.extensions_map['.wasm'] = 'application/wasm' -httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd = socketserver.TCPServer(("", PORT), Handler) httpd.serve_forever() diff --git a/modules/canvaskit/wasm_tools/SIMD/build_simd_test.sh b/modules/canvaskit/wasm_tools/SIMD/build_simd_test.sh index 00db15afba7f..69f8cb615d6d 100755 --- a/modules/canvaskit/wasm_tools/SIMD/build_simd_test.sh +++ b/modules/canvaskit/wasm_tools/SIMD/build_simd_test.sh @@ -33,4 +33,4 @@ grep -f wasm_simd_types.txt output/simd_test.wat # Serve the compiled WASM so output can be manually inspected for correctness. echo "Go check out http://localhost:8000/output/simd_test.html in Chrome Canary 86.0.4186.0 \ or later and enable the chrome://flags#enable-webassembly-simd flag!" -python ../../serve.py +python3 ../../serve.py diff --git a/modules/pathkit/Makefile b/modules/pathkit/Makefile index b257e4425afd..10495ecec7cd 100644 --- a/modules/pathkit/Makefile +++ b/modules/pathkit/Makefile @@ -109,7 +109,7 @@ npm-debug: example: npm install pathkit-asmjs pathkit-wasm echo "Go check out localhost:8000/npm-wasm/example.html" - python serve.py + python3 serve.py local-example: rm -rf node_modules/pathkit-wasm @@ -119,7 +119,7 @@ local-example: ln -s -T ../npm-asmjs node_modules/pathkit-asmjs echo "Go check out http://localhost:8000/npm-wasm/example.html" echo "or http://localhost:8000/npm-asmjs/example.html" - python serve.py + python3 serve.py local-example-test: rm -rf node_modules/pathkit-wasm @@ -130,7 +130,7 @@ local-example-test: ln -s -T ../../npm-asmjs/bin/test node_modules/pathkit-asmjs/bin echo "Go check out localhost:8000/npm-wasm/example.html" echo "or http://localhost:8000/npm-asmjs/example.html" - python serve.py + python3 serve.py local-example-debug: rm -rf node_modules/pathkit-wasm @@ -141,5 +141,5 @@ local-example-debug: ln -s -T ../../npm-asmjs/bin/debug node_modules/pathkit-asmjs/bin echo "Go check out localhost:8000/npm-wasm/example.html" echo "or http://localhost:8000/npm-asmjs/example.html" - python serve.py + python3 serve.py diff --git a/modules/pathkit/compile.sh b/modules/pathkit/compile.sh index 729d5c7d186b..01c1f42db314 100755 --- a/modules/pathkit/compile.sh +++ b/modules/pathkit/compile.sh @@ -127,6 +127,6 @@ ${BUILD_DIR}/libpathkit.a if [[ $@ == *serve* ]]; then pushd $BUILD_DIR - python serve.py + python3 serve.py fi diff --git a/modules/pathkit/serve.py b/modules/pathkit/serve.py index 8c6541f1fb1f..a3e1f2687771 100644 --- a/modules/pathkit/serve.py +++ b/modules/pathkit/serve.py @@ -1,20 +1,21 @@ +#!/usr/bin/env python3 # Copyright 2018 Google LLC - +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver PORT = 8000 -class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): +class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.js'] = 'application/javascript' # Without the correct MIME type, async compilation doesn't work Handler.extensions_map['.wasm'] = 'application/wasm' -httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd = socketserver.TCPServer(("", PORT), Handler) httpd.serve_forever() diff --git a/specs/web-img-decode/proposed/serve.py b/specs/web-img-decode/proposed/serve.py index 36da146d18dd..a3e1f2687771 100644 --- a/specs/web-img-decode/proposed/serve.py +++ b/specs/web-img-decode/proposed/serve.py @@ -1,20 +1,21 @@ +#!/usr/bin/env python3 # Copyright 2018 Google LLC - +# # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import SimpleHTTPServer -import SocketServer +import http.server +import socketserver -PORT = 8005 +PORT = 8000 -class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): +class Handler(http.server.SimpleHTTPRequestHandler): pass Handler.extensions_map['.js'] = 'application/javascript' # Without the correct MIME type, async compilation doesn't work Handler.extensions_map['.wasm'] = 'application/wasm' -httpd = SocketServer.TCPServer(("", PORT), Handler) +httpd = socketserver.TCPServer(("", PORT), Handler) httpd.serve_forever()