def is_current_event_safe():
 for (_, filename, _, _, _, _) in inspect.stack():
  if filename.endswith(UNSAFE_FILES):
   return False
 return True

def is_current_event_safe ( ) : for ( _ , filename , _ , _ , _ , _ ) in inspect . stack ( ) : if filename . endswith ( UNSAFE_FILES ) : return False return True
tests the current stack for unsafe locations that would likely cause recursion if an attempt to send to sentry was made .