From c082e7529da3396bb1c8205ec7c659a863c771b6 Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Mon, 18 May 2015 18:29:59 -0700 Subject: Fix msvc error C2275: 'PyObject' : illegal use of this type as an expression --- simplejson/_speedups.c | 6 ++++-- 1 file 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; } -- cgit v1.2.1