def warnOnException(func):
 def w(*args, **kwds):
  try:
   func(*args, **kwds)
  except:
   printExc('Ignored exception:')
 return w

def warnOnException ( func ) : def w ( * args , ** kwds ) : try : func ( * args , ** kwds ) except : printExc ( 'Ignored exception:' ) return w
decorator that catches/ignores exceptions and prints a stack trace .