[PATCH] D68223: [LNT] Python 3 support: fix convert to JSON
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 08:03:31 PDT 2019
hubert.reinterpretcast accepted this revision.
hubert.reinterpretcast added a comment.
This revision is now accepted and ready to land.
LGTM.
================
Comment at: lnt/formats/JSONFormat.py:27
+ json_str = json.dumps(obj)
+ fp.write(json_str.encode())
+
----------------
According to https://docs.python.org/3/library/json.html, the default argument for `json.dumps`'s `ensure_ascii` parameter is true. I guess this means both Python 2 and Python 3 will behave the same here with `encode()`, so we're okay to just use that.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68223/new/
https://reviews.llvm.org/D68223
More information about the llvm-commits
mailing list