def _safeFormat(fmtString, fmtDict):
 try:
  text = (fmtString % fmtDict)
 except KeyboardInterrupt:
  raise
 except:
  try:
   text = ('Invalid format string or unformattable object in log message: %r, %s' % (fmtString, fmtDict))
  except:
   try:
    text = ('UNFORMATTABLE OBJECT WRITTEN TO LOG with fmt %r, MESSAGE LOST' % (fmtString,))
   except:
    text = 'PATHOLOGICAL ERROR IN BOTH FORMAT STRING AND MESSAGE DETAILS, MESSAGE LOST'
 return text

def _safeFormat ( fmtString , fmtDict ) : try : text = ( fmtString % fmtDict ) except KeyboardInterrupt : raise except : try : text = ( 'Invalid format string or unformattable object in log message: %r, %s' % ( fmtString , fmtDict ) ) except : try : text = ( 'UNFORMATTABLE OBJECT WRITTEN TO LOG with fmt %r, MESSAGE LOST' % ( fmtString , ) ) except : text = 'PATHOLOGICAL ERROR IN BOTH FORMAT STRING AND MESSAGE DETAILS, MESSAGE LOST' return text
helper function for l{safe_repr} and l{safe_str} .