[pypy-dev] [pypy-commit] pypy py3k: The exception handler target "except ValueError as exc" was always compiled as a global variable. Test and fix.

Amaury Forgeot d'Arc amauryfa at gmail.com
Mon Jan 23 16:17:22 CET 2012


2012/1/23 Maciej Fijalkowski <fijall at gmail.com>

> Shouldn't that go to trunk as well?
>

No, this is a bug I introduced in the py3k branch.

in 2.7 the exception target an be any assignment target:
    args = ['An exception', None, 'was raised']
    try:
        raise ValueError(1, 2, 3)
    except ValueError as args[1:2]:
        print args
        # prints ['An exception', 1, 2, 3, 'was raised']

In py3k, the exception target can only be a variable name,
but when doing the change some time ago I did not understand that the now
useless
"set_context(target, ast.Store)" call had to be replaced by something
equivalent.



> On Sun, Jan 22, 2012 at 1:10 PM, amauryfa <noreply at buildbot.pypy.org>
> wrote:
> > Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
> > Branch: py3k
> > Changeset: r51639:e325e4d3227a
> > Date: 2012-01-22 12:02 +0100
> > http://bitbucket.org/pypy/pypy/changeset/e325e4d3227a/
> >
> > Log:    The exception handler target "except ValueError as exc" was
> always
> >        compiled as a global variable. Test and fix.
>



-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120123/99d89f13/attachment.html>


More information about the pypy-dev mailing list