python convert string to int if not none