# HG changeset patch # User Bob Ippolito <bob@redivi.com> # Date 1330374269 28800 # Mon Feb 27 12:24:29 2012 -0800 # Node ID e0df12197a0d28a47fa3310b604c4961104221b7 # Parent eaf2d7c95497faa0dafce9244f87d0c392d7fafa bump to 2.3.3 and clean up indent code diff --git a/CHANGES.txt b/CHANGES.txt --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +Version 2.3.3 released 2012-02-27 + +* Allow unknown numerical types for indent parameter + https://github.com/simplejson/simplejson/pull/29 + Version 2.3.2 released 2011-12-30 * Fix crashing regression in speedups introduced in 2.3.1 @@ -253,7 +258,7 @@ * dump, dumps, load, loads now accept an optional cls kwarg to use an alternate JSONEncoder or JSONDecoder class for convenience. * The read/write compatibility shim for json-py now have deprecation warnings - + Version 1.0 released 2005-12-25 * Initial release diff --git a/conf.py b/conf.py --- a/conf.py +++ b/conf.py @@ -44,7 +44,7 @@ # The short X.Y version. version = '2.3' # The full version, including alpha/beta/rc tags. -release = '2.3.2' +release = '2.3.3' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ DistutilsPlatformError IS_PYPY = hasattr(sys, 'pypy_translation_info') -VERSION = '2.3.2' +VERSION = '2.3.3' DESCRIPTION = "Simple, fast, extensible JSON encoder/decoder for Python" LONG_DESCRIPTION = open('README.rst', 'r').read() diff --git a/simplejson/__init__.py b/simplejson/__init__.py --- a/simplejson/__init__.py +++ b/simplejson/__init__.py @@ -97,7 +97,7 @@ $ echo '{ 1.2:3.4}' | python -m simplejson.tool Expecting property name: line 1 column 2 (char 2) """ -__version__ = '2.3.2' +__version__ = '2.3.3' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONDecodeError', 'JSONEncoder', @@ -189,7 +189,7 @@ If *namedtuple_as_object* is true (default: ``True``), :class:`tuple` subclasses with ``_asdict()`` methods will be encoded as JSON objects. - + If *tuple_as_array* is true (default: ``True``), :class:`tuple` (and subclasses) will be encoded as JSON arrays. @@ -268,7 +268,7 @@ If *namedtuple_as_object* is true (default: ``True``), :class:`tuple` subclasses with ``_asdict()`` methods will be encoded as JSON objects. - + If *tuple_as_array* is true (default: ``True``), :class:`tuple` (and subclasses) will be encoded as JSON arrays. @@ -438,7 +438,7 @@ if enabled: dec.scanstring = dec.c_scanstring or dec.py_scanstring enc.c_make_encoder = c_make_encoder - enc.encode_basestring_ascii = (enc.c_encode_basestring_ascii or + enc.encode_basestring_ascii = (enc.c_encode_basestring_ascii or enc.py_encode_basestring_ascii) scan.make_scanner = scan.c_make_scanner or scan.py_make_scanner else: diff --git a/simplejson/encoder.py b/simplejson/encoder.py --- a/simplejson/encoder.py +++ b/simplejson/encoder.py @@ -170,10 +170,8 @@ self.use_decimal = use_decimal self.namedtuple_as_object = namedtuple_as_object self.tuple_as_array = tuple_as_array - try: + if indent is not None and not isinstance(indent, basestring): indent = indent * ' ' - except TypeError: - pass self.indent = indent if separators is not None: self.item_separator, self.key_separator = separators