summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-22 00:18:11 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-22 00:18:11 +0100
commit7d98c6e7cca7c964ce01afdf88125b147b57943f (patch)
treeedd84ddc32a466d9481fa07a9e42c88e7e849059 /Python/formatter_unicode.c
parent854afa0d9ba5f3450ab807432e590819be3a7f75 (diff)
parentc044b71c5a4088125ba4ed2d2ac91d6497f08214 (diff)
downloadcpython-7d98c6e7cca7c964ce01afdf88125b147b57943f.tar.gz
Merge 3.4 (asyncio)
Diffstat (limited to 'Python/formatter_unicode.c')
-rw-r--r--Python/formatter_unicode.c7
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 */