Start making backport_pr work on Python 3
Merge pull request #5505 from takluyver/backport-pr-py3

Make backport_pr work on Python 3