diff Objects/stringlib/string_format.h @ 42891:252a84280b73

This adds a leak, but fixes a crash. The leaking code is: "{0:.{precision}s}".format('hello world', precision=5) I pretty sure it's because of the 'precision' keyword. Still need to investigate further.
author Neal Norwitz <nnorwitz@gmail.com>
date Mon, 27 Aug 2007 03:22:50 +0000
parents 5fd65e250843
children 6b4781dc81ff
line wrap: on
line diff
--- a/Objects/stringlib/string_format.h	Mon Aug 27 02:49:29 2007 +0000
+++ b/Objects/stringlib/string_format.h	Mon Aug 27 03:22:50 2007 +0000
@@ -416,6 +416,7 @@
             Py_DECREF(key);
             goto error;
         }
+        Py_INCREF(obj);
     } else {
         /* look up in args */
         obj = PySequence_GetItem(args, index);