refine Python 2 support
Merge pull request #1 from lilydjwg/py2-support

refine Python 2 support