More reliable way of checking Python version