summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Ippolito <bob@redivi.com>2018-04-09 10:10:07 -0700
committerGitHub <noreply@github.com>2018-04-09 10:10:07 -0700
commit967a3b33f6df1eb360cb41753f859c5ba309e09e (patch)
tree8b49b16130d412ed4932d6cfa27a52eba7ee7734
parentca2f85ed1f6a7d7679af942faa695f95c30ccbda (diff)
parent17c8dedb66001dc89cb219b1dc1194d0a815b9d3 (diff)
downloadsimplejson-967a3b33f6df1eb360cb41753f859c5ba309e09e.tar.gz
Merge pull request #212 from richvdh/rav/defer_is_rawjson_test
Defer is_raw_json test
-rw-r--r--simplejson/_speedups.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index f352443..df23d15 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -2860,12 +2860,6 @@ encoder_listencode_obj(PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ss
if (encoded != NULL)
rv = _steal_accumulate(rval, encoded);
}
- else if (is_raw_json(obj))
- {
- PyObject *encoded = PyObject_GetAttrString(obj, "encoded_json");
- if (encoded != NULL)
- rv = _steal_accumulate(rval, encoded);
- }
else if (PyInt_Check(obj) || PyLong_Check(obj)) {
PyObject *encoded;
if (PyInt_CheckExact(obj) || PyLong_CheckExact(obj)) {
@@ -2933,6 +2927,12 @@ encoder_listencode_obj(PyEncoderObject *s, JSON_Accu *rval, PyObject *obj, Py_ss
if (encoded != NULL)
rv = _steal_accumulate(rval, encoded);
}
+ else if (is_raw_json(obj))
+ {
+ PyObject *encoded = PyObject_GetAttrString(obj, "encoded_json");
+ if (encoded != NULL)
+ rv = _steal_accumulate(rval, encoded);
+ }
else {
PyObject *ident = NULL;
PyObject *newobj;