diff options
author | Xiang Zhang <angwerzx@126.com> | 2017-05-03 03:16:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-03 03:16:21 (GMT) |
commit | 13f1f423fac39f8f14a3ce919dd236975517d5c6 (patch) | |
tree | 674546ddbbbfaf930c0087eeb1621fab11e25d5f /Modules/clinic | |
parent | 0360a9d015ddbc4e3d58e3ab4b433da27bf1db3a (diff) | |
download | cpython-13f1f423fac39f8f14a3ce919dd236975517d5c6.zip cpython-13f1f423fac39f8f14a3ce919dd236975517d5c6.tar.gz cpython-13f1f423fac39f8f14a3ce919dd236975517d5c6.tar.bz2 |
bpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326)
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/binascii.c.h | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Modules/clinic/binascii.c.h b/Modules/clinic/binascii.c.h index ca5d4c5..130e249 100644 --- a/Modules/clinic/binascii.c.h +++ b/Modules/clinic/binascii.c.h @@ -34,27 +34,31 @@ exit: } PyDoc_STRVAR(binascii_b2a_uu__doc__, -"b2a_uu($module, data, /)\n" +"b2a_uu($module, data, /, *, backtick=False)\n" "--\n" "\n" "Uuencode line of data."); #define BINASCII_B2A_UU_METHODDEF \ - {"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_O, binascii_b2a_uu__doc__}, + {"b2a_uu", (PyCFunction)binascii_b2a_uu, METH_FASTCALL, binascii_b2a_uu__doc__}, static PyObject * -binascii_b2a_uu_impl(PyObject *module, Py_buffer *data); +binascii_b2a_uu_impl(PyObject *module, Py_buffer *data, int backtick); static PyObject * -binascii_b2a_uu(PyObject *module, PyObject *arg) +binascii_b2a_uu(PyObject *module, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) { PyObject *return_value = NULL; + static const char * const _keywords[] = {"", "backtick", NULL}; + static _PyArg_Parser _parser = {"y*|$i:b2a_uu", _keywords, 0}; Py_buffer data = {NULL, NULL}; + int backtick = 0; - if (!PyArg_Parse(arg, "y*:b2a_uu", &data)) { + if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, + &data, &backtick)) { goto exit; } - return_value = binascii_b2a_uu_impl(module, &data); + return_value = binascii_b2a_uu_impl(module, &data, backtick); exit: /* Cleanup for data */ @@ -558,4 +562,4 @@ exit: return return_value; } -/*[clinic end generated code: output=35821bce7e0e4714 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=9db57e86dbe7b2fa input=a9049054013a1b77]*/ |