Made the Python 3.x version check safer