Restore Python 2 support

This is a minimal pull request which restores support for Python 2.7.