Mercurial > cpython-lru_cache-weakref
diff Python/modsupport.c @ 42139:1f7b66a9ffb0
Revert r56044 (which changed the %c format specifier to accept a
unicode char into an int variable) and add %C which does this.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Sun, 01 Jul 2007 21:58:22 +0000 |
| parents | 4db0a0cc57ab |
| children | d0719406b2c6 |
line wrap: on
line diff
--- a/Python/modsupport.c Sat Jun 30 23:44:36 2007 +0000 +++ b/Python/modsupport.c Sun Jul 01 21:58:22 2007 +0000 @@ -385,6 +385,12 @@ 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()) {
