summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-05-23 03:47:11 +0100
committerRaymond Hettinger <python@rcn.com>2014-05-23 03:47:11 +0100
commitdc7f33476cffe6f814446c4a6aafc6ad6fcd32cf (patch)
tree528d142b20b78a5d3096eae6147886ebff20c01e /Python/formatter_unicode.c
parent73c6ceec960db3a8e83ed6e4cc008befc1b79051 (diff)
parent72af09babc226375ffeccd221e001dd688676a9f (diff)
downloadcpython-dc7f33476cffe6f814446c4a6aafc6ad6fcd32cf.tar.gz
merge
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r--Python/formatter_unicode.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/formatter_unicode.c b/Python/formatter_unicode.c
index e3a8149841..056bb76902 100644
--- a/Python/formatter_unicode.c
+++ b/Python/formatter_unicode.c
@@ -846,6 +846,13 @@ format_long_internal(PyObject *value, const InternalFormatSpec *format,
" format specifier 'c'");
goto done;
}
+ /* error to request alternate format */
+ if (format->alternate) {
+ PyErr_SetString(PyExc_ValueError,
+ "Alternate form (#) not allowed with integer"
+ " format specifier 'c'");
+ goto done;
+ }
/* taken from unicodeobject.c formatchar() */
/* Integer input truncated to a character */