Cleaner checking for Python3