diff Objects/stringlib/string_format.h @ 54267:73f62731b1e6 legacy-trunk

Issue 6089: str.format raises SystemError.
author Eric Smith <eric@trueblade.com>
date Sat, 23 May 2009 13:56:13 +0000
parents e7a9e2fd713f
children fd25030223b0
line wrap: on
line diff
--- a/Objects/stringlib/string_format.h	Sat May 23 02:19:36 2009 +0000
+++ b/Objects/stringlib/string_format.h	Sat May 23 13:56:13 2009 +0000
@@ -375,8 +375,9 @@
         *name_idx = get_integer(name);
         break;
     default:
-        /* interal error, can't get here */
-        assert(0);
+        /* Invalid character follows ']' */
+        PyErr_SetString(PyExc_ValueError, "Only '.' or '[' may "
+                        "follow ']' in format field specifier");
         return 0;
     }