Fix parser compatibility with Python 3.