]> granicus.if.org Git - python/commitdiff
Using repr() generates entries that the current stats package can't
authorNicholas Bastin <nick.bastin@gmail.com>
Mon, 12 Jul 2004 23:38:02 +0000 (23:38 +0000)
committerNicholas Bastin <nick.bastin@gmail.com>
Mon, 12 Jul 2004 23:38:02 +0000 (23:38 +0000)
collate, so setting it back to the function name

Lib/profile.py
Lib/test/output/test_profile

index c786c6ae49cbd866e86b75581c112b72604622ac..00a0ae96eaebc0c5956582e8da6d7c61047455d9 100755 (executable)
@@ -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()
index baa25091e9f89a66703e468187c058e0b770f4bf..b46bb6ab739cdf09d46893c02b23a84144b63041 100644 (file)
@@ -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(<built-in function hasattr>)
-        8    0.000    0.000    0.000    0.000 :0(<built-in function range>)
-        1    0.000    0.000    0.000    0.000 :0(<built-in function setprofile>)
+       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 <string>:1(?)
         0    0.000             0.000          profile:0(profiler)
         1    0.000    0.000    1.000    1.000 profile:0(testfunc())