compatibility for py2.6
Merge pull request #2 from huoxy/master

compatibility for py2.6