Mercurial > hg > webaudioevaluationtool
changeset 2377:e04f0f8b6f8f
Fix small python server 2.x/3.x switch
author | Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk> |
---|---|
date | Fri, 20 May 2016 09:51:35 +0100 |
parents | c41caaa96633 |
children | 737e3f18e32b |
files | python/pythonServer.py |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/python/pythonServer.py Thu May 19 10:44:19 2016 +0100 +++ b/python/pythonServer.py Fri May 20 09:51:35 2016 +0100 @@ -122,7 +122,10 @@ s.send_response(200) s.send_header("Content-type", "application/xml") s.end_headers() - s.wfile.write(bytes(reply, "utf-8")) + if sys.version_info[0] == 2: + s.wfile.write(reply) + elif sys.version_info[0] == 3: + s.wfile.write(bytes(reply, "utf-8")) file = open("../saves/save-"+key+".xml",'w') file.write("<waetresult key="+key+"/>") file.close();