diff --git a/wakatime/packages/simplejson/__init__.py b/wakatime/packages/simplejson/__init__.py index ac1e5cb..b7fe828 100644 --- a/wakatime/packages/simplejson/__init__.py +++ b/wakatime/packages/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.2' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', diff --git a/wakatime/packages/simplejson/_speedups.c b/wakatime/packages/simplejson/_speedups.c index fb68e35..9976464 100644 --- a/wakatime/packages/simplejson/_speedups.c +++ b/wakatime/packages/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", @@ -2655,7 +2654,7 @@ encoder_init(PyObject *self, PyObject *args, PyObject *kwds) if (PyInt_Check(int_as_string_bitcount) || PyLong_Check(int_as_string_bitcount)) { static const unsigned int long_long_bitsize = SIZEOF_LONG_LONG * 8; int int_as_string_bitcount_val = (int)PyLong_AsLong(int_as_string_bitcount); - if (int_as_string_bitcount_val > 0 && int_as_string_bitcount_val < long_long_bitsize) { + if (int_as_string_bitcount_val > 0 && int_as_string_bitcount_val < (int)long_long_bitsize) { s->max_long_size = PyLong_FromUnsignedLongLong(1ULL << int_as_string_bitcount_val); s->min_long_size = PyLong_FromLongLong(-1LL << int_as_string_bitcount_val); if (s->min_long_size == NULL || s->max_long_size == NULL) { diff --git a/wakatime/packages/simplejson/encoder.py b/wakatime/packages/simplejson/encoder.py index d771bb4..5b9bda7 100644 --- a/wakatime/packages/simplejson/encoder.py +++ b/wakatime/packages/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]