fix py 2.6 compatibilty

Not extensively tested at the moment, but running test.sh works in python 2.6 and sys.version_info[0] does indeed equal 2 on python 2.7.