py_compile vs. IndentationError

Mr. Magoo magoo at
Sat Mar 26 19:21:58 CET 2005

Why does py_compile print IndentationError in a different format than 
SyntaxError? It makes it harder to parse the output in a non-python 

Sorry: IndentationError: ('unindent does not match any outer indentation 
level', ('', 19, 17, '\t\t\t return 0.0  \n'))

instead of 

   File "", line 19
    zreturn 0.0

for example.

Is there a way for me to wrap this up in a script and transform the 
output on the way out?


More information about the Python-list mailing list