7658: improve the log verification in case of unexpected close.
[arvados.git] / sdk / python / tests / performance / performance_profiler.py
index 484361022c8635853e5c348d18e0d01c492a4a91..afa53ae73c0d2eb5231054889eedbcc3563c202d 100644 (file)
@@ -38,12 +38,12 @@ def profiled(function):
         pr.enable()
         try:
             ret = function(*args, **kwargs)
-        except e:
+        except Exception as e:
             caught = e
         pr.disable()
         ps = pstats.Stats(pr, stream=outfile)
-        ps.print_stats()
+        ps.sort_stats('time').print_stats()
         if caught:
-            raise caught
+            raise
         return ret
     return profiled_function