summaryrefslogtreecommitdiff
path: root/Python/formatter_unicode.c
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-05-22 23:37:31 +0100
committerRaymond Hettinger <python@rcn.com>2014-05-22 23:37:31 +0100
commit6c91cfa6cf2c41251fc33b16da81a2db50bb72d1 (patch)
tree11af82653ee18677482cb53a9415f348188f59c4 /Python/formatter_unicode.c
parent76a8dab235979c20b8481cf13ca2e4bf61e578dc (diff)
parentfcc387425dca970e54cddabb539b54849e7137fc (diff)
downloadcpython-6c91cfa6cf2c41251fc33b16da81a2db50bb72d1.tar.gz
merge
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 */