fix python version check to work in python2 as well as python3

sys.version_info data structure changes between python2 and python3.  Code as it exists breaks in python2.  This change should work for both.