Compatibility with Python 3

It fixes compatibility with Python 3 but brakes compatibility with Python 2.5 or less.

http://docs.python.org/2/reference/datamodel.html#index-35