python check if variable is not nonetype