[Python-checkins] TRUNK IS UNFROZEN, available for 2.6 work if you are so inclined

Georg Brandl g.brandl at gmx.net
Thu Aug 17 16:40:45 CEST 2006


Is the following fix for #1541682 okay?

Georg

Index: Doc/api/intro.tex
===================================================================
--- Doc/api/intro.tex   (Revision 51336)
+++ Doc/api/intro.tex   (Arbeitskopie)
@@ -276,8 +276,12 @@
      if (n < 0)
          return -1;
      for (i = 0; i < n; i++) {
-        if (PyObject_SetItem(target, i, item) < 0)
+        PyObject *index = PyInt_FromLong(i);
+        if (!index)
              return -1;
+        if (PyObject_SetItem(target, index, item) < 0)
+            return -1;
+        Py_DECREF(index);
      }
      return 0;
  }



More information about the Python-checkins mailing list