summaryrefslogtreecommitdiff
path: root/mercurial/lsprof.py
diff options
context:
space:
mode:
Diffstat (limited to 'mercurial/lsprof.py')
-rw-r--r--mercurial/lsprof.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mercurial/lsprof.py b/mercurial/lsprof.py
index 4970f06..e9b185b 100644
--- a/mercurial/lsprof.py
+++ b/mercurial/lsprof.py
@@ -38,8 +38,8 @@ class Stats(object):
d = d[:top]
cols = "% 12s %12s %11.4f %11.4f %s\n"
hcols = "% 12s %12s %12s %12s %s\n"
- file.write(hcols % ("CallCount", "Recursive", "Total(s)",
- "Inline(s)", "module:lineno(function)"))
+ file.write(hcols % ("CallCount", "Recursive", "Total(ms)",
+ "Inline(ms)", "module:lineno(function)"))
count = 0
for e in d:
file.write(cols % (e.callcount, e.reccallcount, e.totaltime,
@@ -48,7 +48,7 @@ class Stats(object):
if limit is not None and count == limit:
return
ccount = 0
- if climit and e.calls:
+ if e.calls:
for se in e.calls:
file.write(cols % ("+%s" % se.callcount, se.reccallcount,
se.totaltime, se.inlinetime,
@@ -86,7 +86,9 @@ def label(code):
for k, v in list(sys.modules.iteritems()):
if v is None:
continue
- if not isinstance(getattr(v, '__file__', None), str):
+ if not hasattr(v, '__file__'):
+ continue
+ if not isinstance(v.__file__, str):
continue
if v.__file__.startswith(code.co_filename):
mname = _fn2mod[code.co_filename] = k