Fix httpserver for Python 3.

This commit is contained in:
Valentin Lorentz 2013-07-07 13:24:26 +02:00
parent 5f1535447c
commit eff7d5e671

View File

@ -316,6 +316,8 @@ class SupyIndex(SupyHTTPServerCallback):
self.send_header('Content-Type', 'text/html; charset=utf-8')
self.send_header('Content-Length', len(response))
self.end_headers()
if sys.version_info[0] >= 3:
response = response.encode()
self.wfile.write(response)
class Static(SupyHTTPServerCallback):
@ -332,6 +334,8 @@ class Static(SupyHTTPServerCallback):
self.send_header('Content-type', self._mimetype)
self.send_header('Content-Length', len(response))
self.end_headers()
if sys.version_info[0] >= 3:
response = response.encode()
self.wfile.write(response)
class Favicon(SupyHTTPServerCallback):