diff options
author | Paul Smith <prs247au@gmail.com> | 2017-06-28 14:17:59 +1000 |
---|---|---|
committer | Paul Smith <prs247au@gmail.com> | 2017-06-28 14:17:59 +1000 |
commit | ee90663dde0e46927d11d049f9a516e5381b0d0f (patch) | |
tree | c5b8205303f473bf5178ec511f32375bdae77087 /jsonrpclib/SimpleJSONRPCServer.py | |
parent | 20e55bb1ffbce03885745d4ad7de775d79d3338a (diff) | |
download | jsonrpclib-ee90663dde0e46927d11d049f9a516e5381b0d0f.tar.gz |
Remove HTTP class and use HTTPConnection instead. Fixes bug for Python 3.x on linux.
Diffstat (limited to 'jsonrpclib/SimpleJSONRPCServer.py')
-rw-r--r-- | jsonrpclib/SimpleJSONRPCServer.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/jsonrpclib/SimpleJSONRPCServer.py b/jsonrpclib/SimpleJSONRPCServer.py index 290fafa..708c5d2 100644 --- a/jsonrpclib/SimpleJSONRPCServer.py +++ b/jsonrpclib/SimpleJSONRPCServer.py @@ -187,7 +187,10 @@ class SimpleJSONRPCRequestHandler( self.send_header("Content-type", "application/json-rpc") self.send_header("Content-length", str(len(response))) self.end_headers() - self.wfile.write(response.encode()) + if isinstance(response, bytes): + self.wfile.write(response) + else: + self.wfile.write(response.encode()) self.wfile.flush() self.connection.shutdown(1) |