Fixing python source for running in latest python