mirror of
https://github.com/python/cpython.git
synced 2025-07-19 09:15:34 +00:00
Checkpoint. A b it closer to working pickles and pickletools.
Added 'Y' getargs opcode which requires a bytes object.
This commit is contained in:
parent
805365ee39
commit
617dbc4d64
4 changed files with 26 additions and 8 deletions
|
@ -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 **);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue