[Python-Dev] [Python-checkins] cpython: Fix #13327. Remove the need for an explicit None as the second argument to

Benjamin Peterson benjamin at python.org
Sun Nov 6 20:46:33 CET 2011


2011/11/6 brian.curtin <python-checkins at python.org>:
> -
> -    if (!PyArg_ParseTuple(args, "O&O:utime",
> +    PyObject* arg = NULL;

You could set arg = Py_None here.
> +
> +    if (!PyArg_ParseTuple(args, "O&|O:utime",
>                           PyUnicode_FSConverter, &opath, &arg))
>         return NULL;
>     path = PyBytes_AsString(opath);
> -    if (arg == Py_None) {
> +    if (!arg || (arg == Py_None)) {

And then not have to change this.



-- 
Regards,
Benjamin


More information about the Python-Dev mailing list