make python3 and 2.5 compatible