Fix issue #38: make it work on python 2.6

Fixes #38