Improve reliability of json parsing in graphDrawer
graphDrawer.py didn't work for me with output produced by
LocalFileSpanReceiver. This fixes the issue, but enforced the assumption of a
single span per input line.
diff --git a/tools/graphDrawer.py b/tools/graphDrawer.py
index 417de2f..46469b7 100755
--- a/tools/graphDrawer.py
+++ b/tools/graphDrawer.py
@@ -38,12 +38,7 @@
def loads_invalid_obj_list(s):
decoder = JSONDecoder()
- s_len = len(s)
- objs = []
- end = 0
- while end != s_len:
- obj, end = decoder.raw_decode(s, idx=end)
- objs.append(obj)
+ objs = [decoder.decode(x) for x in s.split()]
return objs
nodes = loads_invalid_obj_list(sys.stdin.read().strip())