diff options
Diffstat (limited to 'Python/getargs.c')
-rw-r--r-- | Python/getargs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 8331a18965..0f6f21b7df 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 **); |