summaryrefslogtreecommitdiffstats
path: root/Python/getargs.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-07 23:57:08 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-07 23:57:08 (GMT)
commit617dbc4d643749804057f8dc7c52df702e40fe7a (patch)
tree6d8536fa856655cbcfa26404bbdbc495f97f7397 /Python/getargs.c
parent805365ee39298f93e433e19ae0dd87c6f782145b (diff)
downloadcpython-617dbc4d643749804057f8dc7c52df702e40fe7a.zip
cpython-617dbc4d643749804057f8dc7c52df702e40fe7a.tar.gz
cpython-617dbc4d643749804057f8dc7c52df702e40fe7a.tar.bz2
Checkpoint. A b it closer to working pickles and pickletools.
Added 'Y' getargs opcode which requires a bytes object.
Diffstat (limited to 'Python/getargs.c')
-rw-r--r--Python/getargs.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 8331a18..0f6f21b 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -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 **);