Submitter | Yuya Nishihara |
---|---|
Date | April 2, 2017, 3:28 a.m. |
Message ID | <54017aea6a3b5c7a668f.1491103702@mimosa> |
Download | mbox | patch |
Permalink | /patch/19902/ |
State | Accepted |
Headers | show |
Comments
Patch
diff --git a/mercurial/templatefilters.py b/mercurial/templatefilters.py --- a/mercurial/templatefilters.py +++ b/mercurial/templatefilters.py @@ -219,8 +219,12 @@ def indent(text, prefix): @templatefilter('json') def json(obj): - if obj is None or obj is False or obj is True: - return {None: 'null', False: 'false', True: 'true'}[obj] + if obj is None: + return 'null' + elif obj is False: + return 'false' + elif obj is True: + return 'true' elif isinstance(obj, (int, long, float)): return str(obj) elif isinstance(obj, str):