From ad812c853700a3e4e32d6047363fc45b9d177c03 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Sun, 16 Feb 2014 13:52:05 +0200 Subject: [PATCH] debug.profile: support kwargs and ret values --- gramps/gen/utils/debug.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gramps/gen/utils/debug.py b/gramps/gen/utils/debug.py index 2094a89e9..8673fa1eb 100644 --- a/gramps/gen/utils/debug.py +++ b/gramps/gen/utils/debug.py @@ -33,12 +33,12 @@ from __future__ import print_function # Debugging utilities # #------------------------------------------------------------------------- -def profile(func, *args): +def profile(func, *args, **kwargs): import hotshot.stats prf = hotshot.Profile('mystats.profile') print("Start") - prf.runcall(func, *args) + r = prf.runcall(func, *args, **kwargs) print("Finished") prf.close() print("Loading profile") @@ -48,6 +48,7 @@ def profile(func, *args): stats.sort_stats('time', 'calls') stats.print_stats(100) stats.print_callers(100) + return r def format_exception(tb_type=None, tb_value=None, tb=None): """