diff options
author | Georg Brandl <georg@python.org> | 2014-10-06 17:51:53 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-06 17:51:53 +0200 |
commit | 9d2ec0c84470eb9fdec4fe87cb223a425370e6c3 (patch) | |
tree | 3114c6929ece3426beda5e1910070133715faeff /Python/formatter_unicode.c | |
parent | 53230dae4fce857df51a921150058eb07deca019 (diff) | |
parent | b825edd615e1c95f78c3dfc601af978f967618f0 (diff) | |
download | cpython-9d2ec0c84470eb9fdec4fe87cb223a425370e6c3.tar.gz |
merge with 3.4
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 */ |