Change to follow trac 1.5/1.6.

Adjust for python 3.
