summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann QUERET <yoann@queret.net>2021-01-18 10:48:37 +0100
committerGitHub <noreply@github.com>2021-01-18 10:48:37 +0100
commit2124bdca266f14a922010bd18a09c80c9b9917d6 (patch)
tree605bbbef398927a53bfea2c863f0a9025ddab0f3
parent394d284f68fbc8a724fae25a0d2d9492a9b4d835 (diff)
downloaddabmux-2124bdca266f14a922010bd18a09c80c9b9917d6.tar.gz
dabmux-2124bdca266f14a922010bd18a09c80c9b9917d6.tar.bz2
dabmux-2124bdca266f14a922010bd18a09c80c9b9917d6.zip
Make compatible with python 3.5
Solve error "TypeError: the JSON object must be str, not 'bytes'" with python 3.5
-rwxr-xr-xdoc/show_dabmux_stats.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/show_dabmux_stats.py b/doc/show_dabmux_stats.py
index 75998a5..6821296 100755
--- a/doc/show_dabmux_stats.py
+++ b/doc/show_dabmux_stats.py
@@ -22,7 +22,7 @@ def connect():
sock.connect("tcp://localhost:12720")
sock.send(b"info")
- infojson = json.loads(sock.recv())
+ infojson = json.loads(sock.recv().decode("utf-8"))
sys.stderr.write("Statistics from ODR-DabMux {}\n".format(infojson['version']))
@@ -43,7 +43,7 @@ if len(sys.argv) == 1:
if socks:
if socks.get(sock) == zmq.POLLIN:
- data = sock.recv()
+ data = sock.recv().decode("utf-8")
values = json.loads(data)['values']
tmpl = "{ident:20}{maxfill:>8}{minfill:>8}{under:>8}{over:>8}{audioleft:>8}{audioright:>8}{peakleft:>8}{peakright:>8}{state:>16}{version:>48}{uptime:>8}"