diff options
author | Raymond Hettinger <python@rcn.com> | 2014-05-23 03:47:11 +0100 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2014-05-23 03:47:11 +0100 |
commit | dc7f33476cffe6f814446c4a6aafc6ad6fcd32cf (patch) | |
tree | 528d142b20b78a5d3096eae6147886ebff20c01e /Python/formatter_unicode.c | |
parent | 73c6ceec960db3a8e83ed6e4cc008befc1b79051 (diff) | |
parent | 72af09babc226375ffeccd221e001dd688676a9f (diff) | |
download | cpython-dc7f33476cffe6f814446c4a6aafc6ad6fcd32cf.tar.gz |
merge
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r-- | Python/formatter_unicode.c | 7 |
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 */ |