support python >= 2.3 and 3.x