diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-07-01 22:36:29 -0500 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-07-01 22:36:29 -0500 |
commit | c6050850b5f399a24702795515d02fdf06b01b4f (patch) | |
tree | 516c458f0e3ced865031c0698f3e90ef4c6a45d2 /Python/formatter_unicode.c | |
parent | a512845231efe72a741ea90c4573ee500a71e21c (diff) | |
parent | c0bde64a372bc70f61a5300b61559ec8c07a06a9 (diff) | |
download | cpython-c6050850b5f399a24702795515d02fdf06b01b4f.tar.gz |
Merge 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 */ |