equal
deleted
inserted
replaced
339 return res |
339 return res |
340 |
340 |
341 # traceback formatting ######################################################## |
341 # traceback formatting ######################################################## |
342 |
342 |
343 import traceback |
343 import traceback |
|
344 |
|
345 def exc_message(ex, encoding): |
|
346 try: |
|
347 return unicode(ex) |
|
348 except: |
|
349 try: |
|
350 return unicode(str(ex), encoding, 'replace') |
|
351 except: |
|
352 return unicode(repr(ex), encoding, 'replace') |
|
353 |
344 |
354 |
345 def rest_traceback(info, exception): |
355 def rest_traceback(info, exception): |
346 """return a ReST formated traceback""" |
356 """return a ReST formated traceback""" |
347 res = [u'Traceback\n---------\n::\n'] |
357 res = [u'Traceback\n---------\n::\n'] |
348 for stackentry in traceback.extract_tb(info[2]): |
358 for stackentry in traceback.extract_tb(info[2]): |