summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2013-01-01 13:37:34 -0800
committerBob Ippolito <bob@redivi.com>2013-01-01 13:37:34 -0800
commited84084a51367a4731f80794b062f54365ac9c59 (patch)
treee1c9516a3c1df2b76ae08063853e04e7130f976d
parent03396cb26b6165814150461ec9f49343c151d862 (diff)
downloadsimplejson-ed84084a51367a4731f80794b062f54365ac9c59.tar.gz
bump to 3.0.2, fix Py_EnterRecusiveCall/Py_LeaveRecursiveCall balance from 3.0.1v3.0.2
-rw-r--r--CHANGES.txt5
-rw-r--r--conf.py2
-rw-r--r--setup.py2
-rw-r--r--simplejson/__init__.py2
-rw-r--r--simplejson/_speedups.c16
5 files changed, 20 insertions, 7 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 500252b..e65b385 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,8 @@
+Version 3.0.2 released 2013-01-01
+
+* Missed a changeset to _speedups.c in the 3.0.1 branch cut, please
+ DO NOT install 3.0.1!
+
Version 3.0.1 released 2013-01-01
* Add accumulator optimization to encoder, equivalent to the usage of
diff --git a/conf.py b/conf.py
index 7ef1240..40bb423 100644
--- a/conf.py
+++ b/conf.py
@@ -44,7 +44,7 @@ copyright = '2012, Bob Ippolito'
# The short X.Y version.
version = '3.0'
# The full version, including alpha/beta/rc tags.
-release = '3.0.1'
+release = '3.0.2'
# 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
index 3f45697..78c9bcc 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError
IS_PYPY = hasattr(sys, 'pypy_translation_info')
-VERSION = '3.0.1'
+VERSION = '3.0.2'
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 84fea33..647a770 100644
--- a/simplejson/__init__.py
+++ b/simplejson/__init__.py
@@ -99,7 +99,7 @@ Using simplejson.tool from the shell to validate and pretty-print::
Expecting property name: line 1 column 2 (char 2)
"""
from __future__ import absolute_import
-__version__ = '3.0.1'
+__version__ = '3.0.2'
__all__ = [
'dump', 'dumps', 'load', 'loads',
'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index beceeb7..c20243b 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -2312,7 +2312,6 @@ scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_
/* Didn't find a string, object, array, or named constant. Look for a number. */
if (fallthrough)
rval = _match_number_unicode(s, pystr, idx, next_idx_ptr);
- Py_LeaveRecursiveCall();
return rval;
}
@@ -2717,8 +2716,6 @@ encoder_listencode_obj(PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ss
{
/* Encode Python object obj to a JSON term, rval is a PyList */
int rv = -1;
- if (Py_EnterRecursiveCall(" while encoding a JSON document"))
- return rv;
do {
if (obj == Py_None || obj == Py_True || obj == Py_False) {
PyObject *cstr = _encoded_const(obj);
@@ -2748,17 +2745,26 @@ encoder_listencode_obj(PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ss
rv = _steal_accumulate(rval, encoded);
}
else if (s->namedtuple_as_object && _is_namedtuple(obj)) {
+ if (Py_EnterRecursiveCall(" while encoding a JSON object"))
+ return rv;
PyObject *newobj = PyObject_CallMethod(obj, "_asdict", NULL);
if (newobj != NULL) {
rv = encoder_listencode_dict(s, rval, newobj, indent_level);
Py_DECREF(newobj);
}
+ Py_LeaveRecursiveCall();
}
else if (PyList_Check(obj) || (s->tuple_as_array && PyTuple_Check(obj))) {
+ if (Py_EnterRecursiveCall(" while encoding a JSON object"))
+ return rv;
rv = encoder_listencode_list(s, rval, obj, indent_level);
+ Py_LeaveRecursiveCall();
}
else if (PyDict_Check(obj)) {
+ if (Py_EnterRecursiveCall(" while encoding a JSON object"))
+ return rv;
rv = encoder_listencode_dict(s, rval, obj, indent_level);
+ Py_LeaveRecursiveCall();
}
else if (s->use_decimal && PyObject_TypeCheck(obj, (PyTypeObject *)s->Decimal)) {
PyObject *encoded = PyObject_Str(obj);
@@ -2785,12 +2791,15 @@ encoder_listencode_obj(PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ss
break;
}
}
+ if (Py_EnterRecursiveCall(" while encoding a JSON object"))
+ return rv;
newobj = PyObject_CallFunctionObjArgs(s->defaultfn, obj, NULL);
if (newobj == NULL) {
Py_XDECREF(ident);
break;
}
rv = encoder_listencode_obj(s, rval, newobj, indent_level);
+ Py_LeaveRecursiveCall();
Py_DECREF(newobj);
if (rv) {
Py_XDECREF(ident);
@@ -2805,7 +2814,6 @@ encoder_listencode_obj(PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ss
}
}
} while (0);
- Py_LeaveRecursiveCall();
return rv;
}