Michael Layzell added the comment:

This should fix the problem. It appears as though the indentation was being 
stripped from the program text differently depending on how the error was 
produced. In the case of a syntax error from the parser, the indentation was 
maintained until it was printed (in print_error_text, correctly handling the 
offset value). In contrast, errors from the AST were created with 
PyErr_ProgramText*, which would also strip the indentation (without mutating 
any offset value). 

This patch causes the second code path to not strip whitespace. This shouldn't 
cause I problem (I think), as it seems to only be used to instantiate 
SyntaxErrors.

----------
keywords: +patch
Added file: http://bugs.python.org/file41100/cpython25677.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25677>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to