A better way to handle and display the error in a python file.

Former version crashed in case of syntax error
(cf test_syntax_error.py)
[Travis] Synchronize.