more elegant way to detect python version