From 16ae2381fc14d4e91fa3af5d82e01eda6929572e Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Sat, 29 Dec 2012 12:41:55 -0800 Subject: more coverage, decimal key coercion --- simplejson/_speedups.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'simplejson/_speedups.c') diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c index 74fa831..5fbecf2 100644 --- a/simplejson/_speedups.c +++ b/simplejson/_speedups.c @@ -2739,6 +2739,11 @@ encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ss if (kstr == NULL) goto bail; } + else if (s->use_decimal && PyObject_TypeCheck(key, (PyTypeObject *)s->Decimal)) { + kstr = PyObject_Str(key); + if (kstr == NULL) + goto bail; + } else if (skipkeys) { Py_DECREF(item); continue; -- cgit v1.2.1