compatibility with Python 2.6
Merge pull request #641 from xrstf/patch-2

compatibility with Python 2.6