Handle syntax error gracefully

Somehow, the print syntax error does not get detected by "compile()" on
Python 2.