py_compile vs. IndentationError

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. Magoo

    #1

    py_compile vs. IndentationError

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

    Sorry: IndentationErro r: ('unindent does not match any outer indentation
    level', ('foo.py', 19, 17, '\t\t\t return 0.0 \n'))

    instead of

    File "foo.py", 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?

    Magoo
Working...