yes  i know the code works  it just looks strange as user might expect it to have some return value  that s why i said that break the return into it is own line could be cleaner  if you do not like repeated return  move all these code inside try block so you do not need return in each except 