summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/getargs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 4b57153..c3da368 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -828,6 +828,8 @@ convertsimple(PyObject *arg, const char **p_format, va_list *p_va, int flags,
char *p = va_arg(*p_va, char *);
if (PyBytes_Check(arg) && PyBytes_Size(arg) == 1)
*p = PyBytes_AS_STRING(arg)[0];
+ else if (PyByteArray_Check(arg) && PyByteArray_Size(arg) == 1)
+ *p = PyByteArray_AS_STRING(arg)[0];
else
return converterr("a byte string of length 1", arg, msgbuf, bufsize);
break;