Remove trailing commas from JSON lists, they are illegal

This commit is contained in:
Alexander van Gessel 2010-10-11 09:37:12 +01:00
parent e400969bc0
commit b5d709ac64

View file

@ -479,11 +479,15 @@ If verbose, insert a linebreak after every brace and comma (put every item on it
if verbose:
sys.stdout.write(sdepth1)
print '[',
first_tag = True
for tag in pair[1]:
if first_tag:
first_tag = False
else:
sys.stdout.write(",")
if verbose:
sys.stdout.write(sdepth2)
jsonify(tag, verbose, depth + 2)
sys.stdout.write(",")
if verbose:
sys.stdout.write(sdepth2)
sys.stdout.write("]")