summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Gohlke <cgohlke@uci.edu>2015-05-18 18:29:59 -0700
committerChristoph Gohlke <cgohlke@uci.edu>2015-05-18 18:29:59 -0700
commitc082e7529da3396bb1c8205ec7c659a863c771b6 (patch)
tree6ffe939b139d67300b87cf6819824c65b509b530
parente18cc09b688ea1f3305c27616fd3cadd2adc6d31 (diff)
downloadsimplejson-c082e7529da3396bb1c8205ec7c659a863c771b6.tar.gz
Fix msvc error C2275: 'PyObject' : illegal use of this type as an expression
-rw-r--r--simplejson/_speedups.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index 65cf444..bc1648a 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -663,11 +663,12 @@ encoder_stringify_key(PyEncoderObject *s, PyObject *key)
else if (PyInt_Check(key) || PyLong_Check(key)) {
if (!(PyInt_CheckExact(key) || PyLong_CheckExact(key))) {
/* See #118, do not trust custom str/repr */
+ PyObject *res;
PyObject *tmp = PyObject_CallFunctionObjArgs((PyObject *)&PyLong_Type, key, NULL);
if (tmp == NULL) {
return NULL;
}
- PyObject *res = PyObject_Str(tmp);
+ res = PyObject_Str(tmp);
Py_DECREF(tmp);
return res;
}
@@ -2818,11 +2819,12 @@ encoder_encode_float(PyEncoderObject *s, PyObject *obj)
}
else {
/* See #118, do not trust custom str/repr */
+ PyObject *res;
PyObject *tmp = PyObject_CallFunctionObjArgs((PyObject *)&PyFloat_Type, obj, NULL);
if (tmp == NULL) {
return NULL;
}
- PyObject *res = PyObject_Repr(tmp);
+ res = PyObject_Repr(tmp);
Py_DECREF(tmp);
return res;
}