Lisandro Dalcin, 12.03.2010 07:21:
> What do you think? I'd be surprised if I'm not missing something, but
> this is an starter...

Hmm, interesting. Looks like I forgot to open a ticket for that when I went 
through the Py3 syntax differences lately. So you'll have to do that 
yourself (just for documentation purposes, pushing this fix is fine with 
me, as long as you add a couple of tests).


> diff -r 3932a0be3b6b Cython/Compiler/Parsing.py
> --- a/Cython/Compiler/Parsing.py      Thu Mar 11 18:57:06 2010 -0300
> +++ b/Cython/Compiler/Parsing.py      Fri Mar 12 03:18:28 2010 -0300
> @@ -1334,6 +1334,9 @@
>           if s.sy == ',':
>               s.next()
>               exc_value = p_simple_expr(s)
> +        elif s.sy == 'IDENT' and s.systring == 'as':
> +            s.next()
> +            exc_value = p_simple_expr(s)
>       body = p_suite(s)
>       return Nodes.ExceptClauseNode(pos,
>           pattern = exc_type, target = exc_value, body = body)

Sure, why not. That's basically all there is to it syntaxwise. PEP 3110 
also states that multiple exceptions must be put into a tuple (as before), 
so all that really changes is the 'as'.

http://www.python.org/dev/peps/pep-3110/

Personally, I'd merge the two conditions into one, but that's just aesthetics.

Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to