# HG changeset patch # User Christoph Gohlke <cgohlke@uci.edu> # Date 1431998999 25200 # Mon May 18 18:29:59 2015 -0700 # Node ID 6d60b2de4d49d6d9398871c538d7b914633eb465 # Parent 54c9913c31a8acc85e3b9c4ee92aace77d1f9540 Fix msvc error C2275: 'PyObject' : illegal use of this type as an expression diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c --- a/simplejson/_speedups.c +++ b/simplejson/_speedups.c @@ -663,11 +663,12 @@ 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 @@ } 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; }