Updated for python3 via 2to3.