From 12ac3e1f49f06c35a2fe9496e24d66c10e027083 Mon Sep 17 00:00:00 2001 From: Nicholas Bastin Date: Mon, 12 Jul 2004 23:38:02 +0000 Subject: Using repr() generates entries that the current stats package can't collate, so setting it back to the function name --- Lib/profile.py | 8 ++++---- Lib/test/output/test_profile | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lib/profile.py b/Lib/profile.py index c786c6a..00a0ae9 100755 --- a/Lib/profile.py +++ b/Lib/profile.py @@ -216,7 +216,7 @@ class Profile: t = t[0] + t[1] - self.t - self.bias if event == "c_call": - self.c_func_name = repr(arg) + self.c_func_name = arg.__name__ if self.dispatch[event](self, frame,t): t = timer() @@ -233,7 +233,7 @@ class Profile: t = timer() - self.t - self.bias if event == "c_call": - self.c_func_name = repr(arg) + self.c_func_name = arg.__name__ if self.dispatch[event](self, frame, t): self.t = timer() @@ -248,7 +248,7 @@ class Profile: t = timer()/60.0 - self.t - self.bias if event == "c_call": - self.c_func_name = repr(arg) + self.c_func_name = arg.__name__ if self.dispatch[event](self, frame, t): self.t = timer()/60.0 @@ -262,7 +262,7 @@ class Profile: t = get_time() - self.t - self.bias if event == "c_call": - self.c_func_name = repr(arg) + self.c_func_name = arg.__name__ if self.dispatch[event](self, frame, t): self.t = get_time() diff --git a/Lib/test/output/test_profile b/Lib/test/output/test_profile index baa2509..b46bb6a 100644 --- a/Lib/test/output/test_profile +++ b/Lib/test/output/test_profile @@ -4,9 +4,9 @@ test_profile Ordered by: standard name ncalls tottime percall cumtime percall filename:lineno(function) - 12 0.000 0.000 0.012 0.001 :0() - 8 0.000 0.000 0.000 0.000 :0() - 1 0.000 0.000 0.000 0.000 :0() + 12 0.000 0.000 0.012 0.001 :0(hasattr) + 8 0.000 0.000 0.000 0.000 :0(range) + 1 0.000 0.000 0.000 0.000 :0(setprofile) 1 0.000 0.000 1.000 1.000 :1(?) 0 0.000 0.000 profile:0(profiler) 1 0.000 0.000 1.000 1.000 profile:0(testfunc()) -- cgit v0.12