Commit 0ffaaa63 authored by Benjamin Peterson's avatar Benjamin Peterson

Merged revisions 72958 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72958 | benjamin.peterson | 2009-05-26 22:08:44 -0500 (Tue, 26 May 2009) | 1 line

  plug ref leak
........
parent a7205598
...@@ -1126,14 +1126,17 @@ dict_subscript(PyDictObject *mp, register PyObject *key) ...@@ -1126,14 +1126,17 @@ dict_subscript(PyDictObject *mp, register PyObject *key)
if (v == NULL) { if (v == NULL) {
if (!PyDict_CheckExact(mp)) { if (!PyDict_CheckExact(mp)) {
/* Look up __missing__ method if we're a subclass. */ /* Look up __missing__ method if we're a subclass. */
PyObject *missing; PyObject *missing, *res;
static PyObject *missing_str = NULL; static PyObject *missing_str = NULL;
missing = _PyObject_LookupSpecial((PyObject *)mp, missing = _PyObject_LookupSpecial((PyObject *)mp,
"__missing__", "__missing__",
&missing_str); &missing_str);
if (missing != NULL) if (missing != NULL) {
return PyObject_CallFunctionObjArgs(missing, res = PyObject_CallFunctionObjArgs(missing,
key, NULL); key, NULL);
Py_DECREF(missing);
return res;
}
else if (PyErr_Occurred()) else if (PyErr_Occurred())
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment