~ubuntu-branches/ubuntu/quantal/python2.7/quantal

« back to all changes in this revision

Viewing changes to Modules/_json.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-09 19:28:43 UTC
  • mto: (36.1.11 sid)
  • mto: This revision was merged to the branch mainline in revision 51.
  • Revision ID: package-import@ubuntu.com-20120309192843-n84bbtrkfxw34p6n
Tags: upstream-2.7.3~rc1
ImportĀ upstreamĀ versionĀ 2.7.3~rc1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1725
1725
        Py_DECREF(s->encoding);
1726
1726
        s->encoding = tmp;
1727
1727
    }
1728
 
    if (s->encoding == NULL || !PyString_Check(s->encoding))
 
1728
    if (s->encoding == NULL)
1729
1729
        goto bail;
 
1730
    if (!PyString_Check(s->encoding)) {
 
1731
        PyErr_Format(PyExc_TypeError,
 
1732
                     "encoding must be a string, not %.80s",
 
1733
                     Py_TYPE(s->encoding)->tp_name);
 
1734
        goto bail;
 
1735
    }
 
1736
       
1730
1737
 
1731
1738
    /* All of these will fail "gracefully" so we don't need to verify them */
1732
1739
    s->strict = PyObject_GetAttrString(ctx, "strict");