diff Objects/stringlib/string_format.h @ 54268:d2d028f65c7c 2.6

Merged revisions 72848 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r72848 | eric.smith | 2009-05-23 09:56:13 -0400 (Sat, 23 May 2009) | 1 line Issue 6089: str.format raises SystemError. ........
author Eric Smith <eric@trueblade.com>
date Sat, 23 May 2009 14:04:31 +0000
parents 4b4564beb6da
children e38335d4df91
line wrap: on
line diff
--- a/Objects/stringlib/string_format.h	Sat May 23 02:30:55 2009 +0000
+++ b/Objects/stringlib/string_format.h	Sat May 23 14:04:31 2009 +0000
@@ -329,8 +329,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;
     }