diff options
| author | Benjamin Peterson <benjamin@python.org> | 2014-11-02 13:19:15 -0500 |
|---|---|---|
| committer | Benjamin Peterson <benjamin@python.org> | 2014-11-02 13:19:15 -0500 |
| commit | af1fe6055c4df59dfb3a03305e677236c3067413 (patch) | |
| tree | 4dcba18d46fddc094a5517903232edb82ee1ecfd /Python/formatter_unicode.c | |
| parent | 4bb934d3701ef0a4b30b7a9764c42639b2680818 (diff) | |
| parent | 7b7ecfba5681843ddfeb091d6db95843cf12a0d3 (diff) | |
| download | cpython-af1fe6055c4df59dfb3a03305e677236c3067413.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 */ |
