diff options
| author | Brett Cannon <brett@python.org> | 2014-05-09 11:56:07 -0400 |
|---|---|---|
| committer | Brett Cannon <brett@python.org> | 2014-05-09 11:56:07 -0400 |
| commit | 135281656d1569128926cd460cbdf017bb48ef74 (patch) | |
| tree | 2f7f4c05b4e8e15b74922e9c57177461fe086824 /Python/formatter_unicode.c | |
| parent | 328b2c3d974b2f98655105da3f90102f18a62fdc (diff) | |
| parent | 711571d0ee1a7d54a61a85f236788b3a6fded432 (diff) | |
| download | cpython-135281656d1569128926cd460cbdf017bb48ef74.tar.gz | |
Merge for issue #21438
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 */ |
