[Sugar-devel] [PATCH 14/21 sugar-toolkit] sugar.util: use logging.exception instead of traceback.format_exc()
Sascha Silbe
sascha-pgp at silbe.org
Fri Oct 15 17:01:18 EDT 2010
logging.exception() handles exceptions nicely for us, no need to explicitly
use traceback.
Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>
diff --git a/src/sugar/util.py b/src/sugar/util.py
index 889cc62..e0a431b 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)
--
1.7.1
More information about the Sugar-devel
mailing list