fixed backward compatibility with python 2.4, closes #75, thanks @lpsinger