How about setting `value = None` here and get rid of the 3 lingering `else:\n value = None` lines below.