Update example in code documentation of ui.error()

sys.exc_traceback is long deprecated and is seems removed in python2.7,
so document the legitimate use of sys.exc_info()[2] instead.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth 2011-08-14 10:42:21 +02:00 committed by Nicolas Sebrecht
parent c4320786ab
commit 51629b8ffe

View File

@ -92,7 +92,7 @@ class UIBase:
error "msg", detailing at what point the error occurred. error "msg", detailing at what point the error occurred.
In debug mode, we also output the full traceback that occurred In debug mode, we also output the full traceback that occurred
if one has been passed in via sys.exc_traceback. if one has been passed in via sys.info()[2].
Also save the Exception to a stack that can be output at the end Also save the Exception to a stack that can be output at the end
of the sync run when offlineiamp exits. It is recommended to of the sync run when offlineiamp exits. It is recommended to
@ -101,7 +101,7 @@ class UIBase:
One example of such a call might be: One example of such a call might be:
ui.error(exc, sys.exc_traceback, msg="While syncing Folder %s in " ui.error(exc, sys.exc_info()[2], msg="While syncing Folder %s in "
"repo %s") "repo %s")
""" """
cur_thread = threading.currentThread() cur_thread = threading.currentThread()