Mercurial > cpython-lru_cache-weakref
diff Python/getargs.c @ 41643:c6568550b1c6
Checkpoint. A b it closer to working pickles and pickletools.
Added 'Y' getargs opcode which requires a bytes object.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Mon, 07 May 2007 23:57:08 +0000 |
| parents | c48fe4dc34a9 |
| children | 4a9533e9365e |
line wrap: on
line diff
--- a/Python/getargs.c Mon May 07 22:24:25 2007 +0000 +++ b/Python/getargs.c Mon May 07 23:57:08 2007 +0000 @@ -1099,6 +1099,15 @@ return converterr("string", arg, msgbuf, bufsize); break; } + + case 'Y': { /* bytes object */ + PyObject **p = va_arg(*p_va, PyObject **); + if (PyBytes_Check(arg)) + *p = arg; + else + return converterr("bytes", arg, msgbuf, bufsize); + break; + } case 'U': { /* Unicode object */ PyObject **p = va_arg(*p_va, PyObject **); @@ -1640,6 +1649,7 @@ /* object codes */ case 'S': /* string object */ + case 'Y': /* string object */ case 'U': /* unicode string object */ { (void) va_arg(*p_va, PyObject **);
