Fixed Python 3.x version check by using sys.version_info