[Python-porting] Installing different files on Python 2/3

Guido van Rossum guido at python.org
Tue Jul 22 20:27:58 CEST 2014


Good sleuthing, Neil!

Dirkjan: it seems that you need some kind of minimal helper function that
wraps the exec() call to avoid this bug. Essentially you should just keep
your pyexec() helper but change its body to exec(...).


On Tue, Jul 22, 2014 at 7:43 AM, Neil Muller <drnlmuller at gmail.com> wrote:

> On 22 July 2014 15:02, Dirkjan Ochtman <dirkjan at ochtman.nl> wrote:
> >
> > The only thing that doesn't match is that I replaced util.pyexec() by
> > just exec(), as you suggested. And all the Google hits about
> > unqualified exec wouldn't seem to apply to this code, as I'm supplying
> > both globals and locals (though the empty locals dict is confusingly
> > named globals_ here).
>
> This looks a lot like http://bugs.python.org/issue21591 , which
> suggests that exec(s, {}, {}) and "exec in {}, {}" aren't identical
> when nested functions are involved.
>
> --
> Neil Muller
> drnlmuller at gmail.com
> _______________________________________________
> Python-porting mailing list
> Python-porting at python.org
> https://mail.python.org/mailman/listinfo/python-porting
>



-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-porting/attachments/20140722/027a1366/attachment.html>


More information about the Python-porting mailing list