From 717ef25da56a7e29063d95b1051b23e0e5e83ae7 Mon Sep 17 00:00:00 2001 From: JackDandy Date: Tue, 12 Jan 2016 01:43:26 +0000 Subject: [PATCH] Update SimpleJSON library 3.8.0 (a37a9bd) to 3.8.1 (6022794). --- CHANGES.md | 1 + lib/simplejson/__init__.py | 2 +- lib/simplejson/_speedups.c | 1 - lib/simplejson/encoder.py | 12 ++++++++---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 57322253..4219f3fb 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -17,6 +17,7 @@ * Update PNotify library 2.0.1 to 2.1.0 * Update profilehooks 1.4 to 1.8.2.dev0 (ee3f1a8) * Update Requests library 2.7.0 (5d6d1bc) to 2.9.1 (a1c9b84) +* Update SimpleJSON library 3.8.0 (a37a9bd) to 3.8.1 (6022794) ### 0.11.0 (2016-01-10 22:30:00 UTC) diff --git a/lib/simplejson/__init__.py b/lib/simplejson/__init__.py index ac1e5cb5..c4487421 100644 --- a/lib/simplejson/__init__.py +++ b/lib/simplejson/__init__.py @@ -97,7 +97,7 @@ Using simplejson.tool from the shell to validate and pretty-print:: Expecting property name: line 1 column 3 (char 2) """ from __future__ import absolute_import -__version__ = '3.8.0' +__version__ = '3.8.1' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', diff --git a/lib/simplejson/_speedups.c b/lib/simplejson/_speedups.c index fb68e359..173c5e10 100644 --- a/lib/simplejson/_speedups.c +++ b/lib/simplejson/_speedups.c @@ -2596,7 +2596,6 @@ encoder_init(PyObject *self, PyObject *args, PyObject *kwds) "use_decimal", "namedtuple_as_object", "tuple_as_array", - "iterable_as_array" "int_as_string_bitcount", "item_sort_key", "encoding", diff --git a/lib/simplejson/encoder.py b/lib/simplejson/encoder.py index d771bb48..5b9bda72 100644 --- a/lib/simplejson/encoder.py +++ b/lib/simplejson/encoder.py @@ -496,10 +496,14 @@ def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, chunks = _iterencode(value, _current_indent_level) for chunk in chunks: yield chunk - if newline_indent is not None: - _current_indent_level -= 1 - yield '\n' + (_indent * _current_indent_level) - yield ']' + if first: + # iterable_as_array misses the fast path at the top + yield '[]' + else: + if newline_indent is not None: + _current_indent_level -= 1 + yield '\n' + (_indent * _current_indent_level) + yield ']' if markers is not None: del markers[markerid]