def change_dict_key(d, from_key, to_key):
 try:
  d[to_key] = d.pop(from_key)
 except KeyError:
  pass

def change_dict_key ( d , from_key , to_key ) : try : d [ to_key ] = d . pop ( from_key ) except KeyError : pass
changes a dictionarys key from from_key to to_key .