Correct for Python 3.x.

The script was adapted to comply to Python 3.x syntax.