Checkpoint. A b it closer to working pickles and pickletools.

Added 'Y' getargs opcode which requires a bytes object.
This commit is contained in:
Guido van Rossum 2007-05-07 23:57:08 +00:00
parent 805365ee39
commit 617dbc4d64
4 changed files with 26 additions and 8 deletions

View file

@ -1099,6 +1099,15 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
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 @@ skipitem(const char **p_format, va_list *p_va, int flags)
/* object codes */
case 'S': /* string object */
case 'Y': /* string object */
case 'U': /* unicode string object */
{
(void) va_arg(*p_va, PyObject **);