diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2011-10-01 20:49:36 +0000 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-09-27 13:27:51 +0000 |
commit | 921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch) | |
tree | 3c4a89176ea67fe4c7bf7b375488361a823c95fa /mercurial/lsprof.py | |
parent | 9039c805b0a7e36220101323f82735f08a104b37 (diff) | |
download | mercurial-tarball-921ced43c48c1d170452a7b251b94cc96ec8dd44.tar.gz |
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'mercurial/lsprof.py')
-rw-r--r-- | mercurial/lsprof.py | 10 |
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 |