# HG changeset patch # User Gregory Szorc # Date 2017-03-14 01:31:29 # Node ID ab3e9eab754f2c714004d8dfa01ec8611b930b39 # Parent 361bccce566afe250c8d258f770a908713b2d13f formatter: support json formatting of long type By luck, we appear to not pass any long instances into the JSON formatter. I suspect this will change with all the Python 3 porting work. Plus I have another series that will convert some ints to longs that triggers this. diff --git a/mercurial/formatter.py b/mercurial/formatter.py --- a/mercurial/formatter.py +++ b/mercurial/formatter.py @@ -295,7 +295,7 @@ def _jsonifyobj(v): return 'true' elif v is False: return 'false' - elif isinstance(v, (int, float)): + elif isinstance(v, (int, long, float)): return str(v) else: return '"%s"' % encoding.jsonescape(v)