fix output of wsdump.py with python3

This commit is contained in:
Simó Albert i Beltran
2015-05-13 18:17:53 +02:00
parent 3dacda7095
commit 066750eced

View File

@@ -116,6 +116,8 @@ def main():
while True:
opcode, data = recv()
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:
msg = "< %s" % data
elif args.verbose: