Lutz Roeder 8 лет назад
Родитель
Сommit
eaf15f719b
2 измененных файлов с 3 добавлено и 2 удалено
  1. 2 1
      netron
  2. 1 1
      src/netron.py

+ 2 - 1
netron

@@ -3,4 +3,5 @@
 [ -d node_modules ] || npm install
 rm -rf ./build/python
 python ./setup.py --quiet build
-PYTHONPATH=./build/python/lib python ./build/python/scripts-2.7/netron $@
+PYTHON_VERSION=$(python -c "import sys; print('.'.join(str(x) for x in sys.version_info[:2]))")
+PYTHONPATH=./build/python/lib python ./build/python/scripts-${PYTHON_VERSION}/netron $@

+ 1 - 1
src/netron.py

@@ -79,7 +79,7 @@ class MyHTTPRequestHandler(BaseHTTPRequestHandler):
         self.end_headers()
         if self.command != 'HEAD':
             if status_code == 404 and buffer is None:
-                self.wfile.write(str(status_code))
+                self.wfile.write(bytes(status_code))
             elif (status_code == 200 or status_code == 404) and buffer != None:
                 self.wfile.write(buffer)
         return