[Erp5-report] r46009 arnaud.fontaine - /erp5/trunk/utils/erp5.utils.benchmark/src/erp5/util...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Aug 29 14:37:54 CEST 2011


Author: arnaud.fontaine
Date: Mon Aug 29 14:37:54 2011
New Revision: 46009

URL: http://svn.erp5.org?rev=46009&view=rev
Log:
Display properly the traceback upon error

Modified:
    erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/benchmark.py

Modified: erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/benchmark.py
URL: http://svn.erp5.org/erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/benchmark.py?rev=46009&r1=46008&r2=46009&view=diff
==============================================================================
--- erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/benchmark.py [utf8] (original)
+++ erp5/trunk/utils/erp5.utils.benchmark/src/erp5/utils/benchmark/benchmark.py [utf8] Mon Aug 29 14:37:54 2011
@@ -304,7 +304,9 @@ class CSVBenchmarkResult(BenchmarkResult
 
     if exc_type:
       msg = "An error occured, see: %s" % self._log_filename_path
-      self.getLogger().error("%s: %s\n%s" % (exc_type, exc_value, traceback))
+      from traceback import format_tb
+      self.getLogger().error("%s: %s\n%s" % (exc_type, exc_value,
+                                             ''.join(format_tb(traceback))))
       if isinstance(exc_type, StopIteration):
         raise StopIteration, msg
       else:
@@ -468,9 +470,9 @@ class BenchmarkProcess(multiprocessing.P
     exit_msg = None
 
     try:
-      self._browser = self.getBrowser(result_instance.log_file)
-
       with result_instance as result:
+        self._browser = self.getBrowser(result_instance.log_file)
+
         while self._current_repeat != (self._argument_namespace.repeat + 1):
           self._logger.info("Iteration: %d" % self._current_repeat)
           self.runBenchmarkSuiteList(result)
@@ -487,8 +489,5 @@ class BenchmarkProcess(multiprocessing.P
       exit_msg = e
       exit_status = 2
 
-    if exit_msg:
-      self._logger.error(exit_msg)
-
     self._exit_msg_queue.put(exit_msg)
     sys.exit(exit_status)



More information about the Erp5-report mailing list