Made the script compatible with older Pythons, usefull for those stuck with older systems like RHEL5

Compatibility with Python versions < 2.7