Skip to content

Commit

Permalink
python3: fix thinkg again to get it working on python3.
Browse files Browse the repository at this point in the history
  • Loading branch information
deavid committed May 9, 2015
1 parent eb18ac4 commit 2f46820
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions bjsonrpc/connection.py
Expand Up @@ -49,8 +49,11 @@


_log = logging.getLogger(__name__)
try:
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
from http.server import BaseHTTPRequestHandler

from BaseHTTPServer import BaseHTTPRequestHandler
from email.message import Message

class HTTPRequest(BaseHTTPRequestHandler):
Expand Down Expand Up @@ -755,7 +758,7 @@ def write_line(self, data):
msg.add_header('Content-Length', str(len(data)))
msg.set_payload(data, charset='utf-8')
self._wbuffer += 'HTTP/1.0 200 OK\n'+msg.as_string()
print self._wbuffer
#print(self._wbuffer)
else:
self._wbuffer += data + b'\n'
sbytes = 0
Expand Down
2 changes: 1 addition & 1 deletion bjsonrpc/serialsocket.py
Expand Up @@ -9,7 +9,7 @@
"""

import serial
#import serial

class SerialSocket:
def __init__(self, serial_port):
Expand Down

0 comments on commit 2f46820

Please sign in to comment.