diff options
| author | Raymond Hettinger <python@rcn.com> | 2014-08-10 10:41:52 -0700 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2014-08-10 10:41:52 -0700 |
| commit | d4cc49f5f367f488379150588d07c7f77dc917e5 (patch) | |
| tree | 97b4a85c63fe35d488668f2f3d9652231431a572 /Python/formatter_unicode.c | |
| parent | 9aebd07ac628842838a281dad04c891c410b0396 (diff) | |
| parent | 7f8878040c398fac32114fb7072cfabf7f7f3fa6 (diff) | |
| download | cpython-d4cc49f5f367f488379150588d07c7f77dc917e5.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 */ |
