Applying Python 3 support patch by Brian Jones.
12 files changed