X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/a8a79114bdb1b02d5c071a1efce2796f633976ed..86f04235021d84afa0d28d105111422e0dd15738:/sdk/python/tests/performance/performance_profiler.py diff --git a/sdk/python/tests/performance/performance_profiler.py b/sdk/python/tests/performance/performance_profiler.py index 7f0766e3ef..afa53ae73c 100644 --- a/sdk/python/tests/performance/performance_profiler.py +++ b/sdk/python/tests/performance/performance_profiler.py @@ -38,12 +38,12 @@ def profiled(function): pr.enable() try: ret = function(*args, **kwargs) - except: - caught = sys.exc_info()[0] + 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