Merge pull request #185 from sim6/fix-py3

fix output of wsdump.py with python3
This commit is contained in:
liris
2015-05-18 08:16:45 +09:00

View File

@@ -118,6 +118,8 @@ def main():
while True: while True:
opcode, data = recv() opcode, data = recv()
msg = None msg = None
if six.PY3 and opcode == websocket.ABNF.OPCODE_TEXT and isinstance(data, bytes):
data = str(data, "utf-8")
if not args.verbose and opcode in OPCODE_DATA: if not args.verbose and opcode in OPCODE_DATA:
msg = "< %s" % data msg = "< %s" % data
elif args.verbose: elif args.verbose: