diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
index ff714ca2bc6e7614faf4498aca2eae5ee5086a82_c2ltcGxlanNvbi9fc3BlZWR1cHMuYw==..11488d9da67a7e7a2b970ef7ef49f839b5657057_c2ltcGxlanNvbi9fc3BlZWR1cHMuYw== 100644
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -698,6 +698,7 @@
             // item can be added as-is
         }
         else {
+            PyObject *tpl;
             kstr = encoder_stringify_key(s, key);
             if (kstr == NULL)
                 goto bail;
@@ -709,7 +710,7 @@
             value = PyTuple_GET_ITEM(item, 1);
             if (value == NULL)
                 goto bail;
-            PyObject *tpl = PyTuple_Pack(2, kstr, value);
+            tpl = PyTuple_Pack(2, kstr, value);
             if (tpl == NULL)
                 goto bail;
             Py_CLEAR(kstr);
@@ -867,6 +868,7 @@
     char *buf = PyString_AS_STRING(pystr);
     PyObject *chunks = NULL;
     PyObject *chunk = NULL;
+    PyObject *strchunk = NULL;
 
     if (len == end) {
         raise_errmsg("Unterminated string starting at", pystr, begin);
@@ -910,7 +912,7 @@
                 goto bail;
             }
 #else /* PY_MAJOR_VERSION >= 3 */
-            PyObject *strchunk = PyString_FromStringAndSize(&buf[end], next - end);
+            strchunk = PyString_FromStringAndSize(&buf[end], next - end);
             if (strchunk == NULL) {
                 goto bail;
             }
@@ -2745,5 +2747,6 @@
                 rv = _steal_accumulate(rval, encoded);
         }
         else if (s->namedtuple_as_object && _is_namedtuple(obj)) {
+            PyObject *newobj;
             if (Py_EnterRecursiveCall(" while encoding a JSON object"))
                 return rv;
@@ -2748,6 +2751,6 @@
             if (Py_EnterRecursiveCall(" while encoding a JSON object"))
                 return rv;
-            PyObject *newobj = PyObject_CallMethod(obj, "_asdict", NULL);
+            newobj = PyObject_CallMethod(obj, "_asdict", NULL);
             if (newobj != NULL) {
                 rv = encoder_listencode_dict(s, rval, newobj, indent_level);
                 Py_DECREF(newobj);