summaryrefslogtreecommitdiff
path: root/Python/modsupport.c
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2007-07-01 21:58:22 +0000
committerWalter Dörwald <walter@livinglogic.de>2007-07-01 21:58:22 +0000
commit253b24ae8ee581ebbba032528e8bbe36253b0564 (patch)
tree415d1585e40ed531a2f1d05643fa8800f05accee /Python/modsupport.c
parentee852e8a5681fa74602cf355a9c352ca81a93c3c (diff)
downloadcpython-253b24ae8ee581ebbba032528e8bbe36253b0564.tar.gz
Revert r56044 (which changed the %c format specifier to accept a
unicode char into an int variable) and add %C which does this.
Diffstat (limited to 'Python/modsupport.c')
-rw-r--r--Python/modsupport.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Python/modsupport.c b/Python/modsupport.c
index ba464099dd..330da5fe80 100644
--- a/Python/modsupport.c
+++ b/Python/modsupport.c
@@ -385,6 +385,12 @@ do_mkvalue(const char **p_format, va_list *p_va, int flags)
case 'c':
{
+ char p[1];
+ p[0] = (char)va_arg(*p_va, int);
+ return PyString_FromStringAndSize(p, 1);
+ }
+ case 'C':
+ {
int i = va_arg(*p_va, int);
Py_UNICODE c;
if (i < 0 || i > PyUnicode_GetMax()) {