def iter_except(func, exception):
 try:
  while True:
   (yield func())
 except exception:
  pass

def iter_except ( func , exception ) : try : while True : ( yield func ( ) ) except exception : pass
iter_except calls func repeatedly until an exception is raised .