Re: [Python-checkins] cpython: Fix email post-commit review comments.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [Python-checkins] cpython: Fix email post-commit review comments.

Nick Coghlan
On Wed, Apr 18, 2012 at 11:31 PM, brian.curtin
<[hidden email]> wrote:
> -    if (name == NULL)
> +    if (name == NULL) {
> +        Py_INCREF(Py_None);
>         name = Py_None;
> +    }

A slightly more traditional way to write that would be:

    name = Py_None;
    Py_INCREF(name);

> -    if (path == NULL)
> +    if (path == NULL) {
> +        Py_INCREF(Py_None);
>         path = Py_None;
> +    }

Ditto.

>
>     Py_INCREF(msg);
> -    PyTuple_SetItem(args, 0, msg);
> +    PyTuple_SetItem(args, 0, NULL);//msg);

However, *this* looks a lot more suspicious... accidental commit of
debugging code?

(if not for spotting this last problem, I wouldn't have even mentioned
the first two)

Cheers,
Nick.

--
Nick Coghlan   |   [hidden email]   |   Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com
Reply | Threaded
Open this post in threaded view
|

Re: [Python-checkins] cpython: Fix email post-commit review comments.

R. David Murray
We're seeing segfuilts on the buildbots now.  Example:

http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x/builds/5715

On Wed, 18 Apr 2012 23:39:34 +1000, Nick Coghlan <[hidden email]> wrote:

> On Wed, Apr 18, 2012 at 11:31 PM, brian.curtin
> <[hidden email]> wrote:
> > -    if (name == NULL)
> > +    if (name == NULL) {
> > +        Py_INCREF(Py_None);
> >         name = Py_None;
> > +    }
>
> A slightly more traditional way to write that would be:
>
>     name = Py_None;
>     Py_INCREF(name);
>
> > -    if (path == NULL)
> > +    if (path == NULL) {
> > +        Py_INCREF(Py_None);
> >         path = Py_None;
> > +    }
>
> Ditto.
>
> >
> >     Py_INCREF(msg);
> > -    PyTuple_SetItem(args, 0, msg);
> > +    PyTuple_SetItem(args, 0, NULL);//msg);
>
> However, *this* looks a lot more suspicious... accidental commit of
> debugging code?
>
> (if not for spotting this last problem, I wouldn't have even mentioned
> the first two)
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan@gmail.com   |   Brisbane, Australia
> _______________________________________________
> Python-Dev mailing list
> [hidden email]
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/rdmurray%40bitdance.com

_______________________________________________
Python-Dev mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/lists%2B1324100855712-1801473%40n6.nabble.com