Don't use CStringIO to format a traceback
The traceback module has format_exc() for this purpose so let's use that. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
928c363044
commit
8e2589982c
@ -21,7 +21,6 @@ import time
|
|||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import threading
|
import threading
|
||||||
from StringIO import StringIO
|
|
||||||
import offlineimap
|
import offlineimap
|
||||||
|
|
||||||
debugtypes = {'':'Other offlineimap related sync messages',
|
debugtypes = {'':'Other offlineimap related sync messages',
|
||||||
@ -309,10 +308,8 @@ class UIBase:
|
|||||||
s.terminate(100)
|
s.terminate(100)
|
||||||
|
|
||||||
def getMainExceptionString(s):
|
def getMainExceptionString(s):
|
||||||
sbuf = StringIO()
|
return "Main program terminated with exception:\n%s\n" %\
|
||||||
traceback.print_exc(file = sbuf)
|
traceback.format_exc() + \
|
||||||
return "Main program terminated with exception:\n" + \
|
|
||||||
sbuf.getvalue() + "\n" + \
|
|
||||||
s.getThreadDebugLog(threading.currentThread())
|
s.getThreadDebugLog(threading.currentThread())
|
||||||
|
|
||||||
def mainException(s):
|
def mainException(s):
|
||||||
|
Loading…
Reference in New Issue
Block a user