Portable for both python 2.X and 3.X