Compatible with Python 2.5, thanks @joncas!