raise from Python syntax not supported

Issue #777 resolved
Robert Lehmann
created an issue

I'm copying this bug here, as it seems to be related to Pygments:

sandrotosi wrote:

//Hello, it seems sphinx doesn't like the PEP 409, as you can see at://

//http://docs.python.org/dev/whatsnew/3.3.html#pep-409-suppressing-exception-context //

//"from None" gets the '...' attached and the next command line receives an extra new line right after the prompt.//

See https://bitbucket.org/birkenfeld/sphinx/issue/938/support-pep-409 for original report.

It //think// I have isolated the error to {{{PythonLexer}}} but I might be entirely mistaken:

{{{

!pycon

list(pygments.lexers.PythonLexer().get_tokens_unprocessed('raise E from e\nprint 1')) [ (0, Token.Keyword, 'raise'), (5, Token.Text, ' '), (6, Token.Name, 'E'), (7, Token.Text, ' '), (8, Token.Keyword.Namespace, 'from'), (12, Token.Text, ' '), (13, Token.Name.Namespace, 'e'), (15, Token.Text, u'\n'), #<<< should be 14? (15, Token.Keyword, 'print'), (20, Token.Text, ' '), (21, Token.Literal.Number.Integer, '1') ] }}}

Comments (2)

  1. Log in to comment