From 431e36a4277809434af4e07639055cdd75036add Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Fri, 15 Oct 2010 19:47:41 +0000 Subject: [PATCH] sugar.util: use logging.exception instead of traceback.format_exc() logging.exception() handles exceptions nicely for us, no need to explicitly use traceback. Reviewed-by: James Cameron Acked-by: Simon Schampijer CC: Aleksey Lim --- src/sugar/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sugar/util.py b/src/sugar/util.py index b2ff439f..25a5ab23 100644 --- a/src/sugar/util.py +++ b/src/sugar/util.py @@ -29,7 +29,6 @@ import gettext import tempfile import logging import atexit -import traceback _ = lambda msg: gettext.dgettext('sugar-toolkit', msg) @@ -336,7 +335,7 @@ def _cleanup_temp_files(): try: os.unlink(path) except: - logging.error(traceback.format_exc()) + logging.exception('Exception occured in _cleanup_temp_files') atexit.register(_cleanup_temp_files)