prepare for py3
This commit is contained in:
@@ -44,7 +44,6 @@ class InteractiveConsole(code.InteractiveConsole):
|
|||||||
sys.stdout.write("\n> ")
|
sys.stdout.write("\n> ")
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
def raw_input(self, prompt):
|
def raw_input(self, prompt):
|
||||||
line = raw_input(prompt)
|
line = raw_input(prompt)
|
||||||
if ENCODING and ENCODING != "utf-8" and not isinstance(line, unicode):
|
if ENCODING and ENCODING != "utf-8" and not isinstance(line, unicode):
|
||||||
@@ -61,8 +60,8 @@ def main():
|
|||||||
ws = websocket.create_connection(args.url)
|
ws = websocket.create_connection(args.url)
|
||||||
if args.verbose > 1:
|
if args.verbose > 1:
|
||||||
websocket.enableTrace(True)
|
websocket.enableTrace(True)
|
||||||
print "Press Ctrl+C to quit"
|
print("Press Ctrl+C to quit")
|
||||||
|
|
||||||
def recv():
|
def recv():
|
||||||
frame = ws.recv_frame()
|
frame = ws.recv_frame()
|
||||||
if not frame:
|
if not frame:
|
||||||
@@ -108,4 +107,4 @@ if __name__ == "__main__":
|
|||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print e
|
print(e)
|
||||||
|
Reference in New Issue
Block a user