move Py version test to near start of file