diff options
author | Bob Ippolito <bob@redivi.com> | 2012-02-27 12:24:29 -0800 |
---|---|---|
committer | Bob Ippolito <bob@redivi.com> | 2012-02-27 12:24:29 -0800 |
commit | 9069fbfe3d856e4b66b42c9a354423812e5a593b (patch) | |
tree | 48f5f6df785954991ccd1b9eaaa1f468550ca8b9 | |
parent | 51744f7fa9aed5b29eabfd5598a9272c76d4879d (diff) | |
download | simplejson-9069fbfe3d856e4b66b42c9a354423812e5a593b.tar.gz |
bump to 2.3.3 and clean up indent codev2.3.3
-rw-r--r-- | CHANGES.txt | 7 | ||||
-rw-r--r-- | conf.py | 2 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | simplejson/__init__.py | 8 | ||||
-rw-r--r-- | simplejson/encoder.py | 4 |
5 files changed, 13 insertions, 10 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 675bfcf..b98a371 100644 --- 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 @@ Version 1.1 released 2005-12-31 * 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 @@ -44,7 +44,7 @@ copyright = '2011, Bob Ippolito' # 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: @@ -7,7 +7,7 @@ from distutils.errors import CCompilerError, DistutilsExecError, \ 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 index 7be8562..3ee7893 100644 --- a/simplejson/__init__.py +++ b/simplejson/__init__.py @@ -97,7 +97,7 @@ Using simplejson.tool from the shell to validate and pretty-print:: $ 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 @@ def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, 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 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, 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 @@ def _toggle_speedups(enabled): 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 index 74719d2..7f4f1cb 100644 --- a/simplejson/encoder.py +++ b/simplejson/encoder.py @@ -170,10 +170,8 @@ class JSONEncoder(object): 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 |