# HG changeset patch
# User Bob Ippolito <bob@redivi.com>
# Date 1357080880 28800
#      Tue Jan 01 14:54:40 2013 -0800
# Node ID 290c22b18beba9741f6e47b56930a35a6943dec5
# Parent  8bf73f736cf10a20e1e9895ae8adc965a8f579df
Revert "Merge pull request #46 from cgohlke/patch-1"

This reverts commit 1aa8819498321dbfc601ff8a304d0c8a901f76da, reversing
changes made to ed84084a51367a4731f80794b062f54365ac9c59.

diff --git a/simplejson/_speedups.c b/simplejson/_speedups.c
--- a/simplejson/_speedups.c
+++ b/simplejson/_speedups.c
@@ -698,7 +698,6 @@
             // item can be added as-is
         }
         else {
-            PyObject *tpl;
             kstr = encoder_stringify_key(s, key);
             if (kstr == NULL)
                 goto bail;
@@ -710,7 +709,7 @@
             value = PyTuple_GET_ITEM(item, 1);
             if (value == NULL)
                 goto bail;
-            tpl = PyTuple_Pack(2, kstr, value);
+            PyObject *tpl = PyTuple_Pack(2, kstr, value);
             if (tpl == NULL)
                 goto bail;
             Py_CLEAR(kstr);
@@ -868,7 +867,6 @@
     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);
@@ -912,7 +910,7 @@
                 goto bail;
             }
 #else /* PY_MAJOR_VERSION >= 3 */
-            strchunk = PyString_FromStringAndSize(&buf[end], next - end);
+            PyObject *strchunk = PyString_FromStringAndSize(&buf[end], next - end);
             if (strchunk == NULL) {
                 goto bail;
             }
@@ -2747,10 +2745,9 @@
                 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;
-            newobj = PyObject_CallMethod(obj, "_asdict", NULL);
+            PyObject *newobj = PyObject_CallMethod(obj, "_asdict", NULL);
             if (newobj != NULL) {
                 rv = encoder_listencode_dict(s, rval, newobj, indent_level);
                 Py_DECREF(newobj);