2to3-3.2 conversion.

Supposed to be compatible with Python 3 now.
Needs testing, however.