def filter_raising_callables(it, exception, *args, **kwargs):
 for elem in it:
  try:
   (yield elem(*args, **kwargs))
  except exception:
   pass

def filter_raising_callables ( it , exception , * args , ** kwargs ) : for elem in it : try : ( yield elem ( * args , ** kwargs ) ) except exception : pass
filters all callable items inside the given iterator that raise the given exceptions .