Some changes in preparation for Python 3.
Authored by: bugman 2012-09-27
Parent: [r17575]
Child: [r17577]