~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lsprof.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-20 04:20:19 UTC
  • mfrom: (3062.2.13 fast-plan-merge2)
  • Revision ID: pqm@pqm.ubuntu.com-20071220042019-wsij5vgvhgw4qhdt
Annotate merge can do cherrypicks (abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
from _lsprof import Profiler, profiler_entry
12
12
 
13
13
 
 
14
import bzrlib.osutils
 
15
 
 
16
 
14
17
__all__ = ['profile', 'Stats']
15
18
 
16
19
_g_threadmap = {}
128
131
            otherwise the format is given by the filename extension.
129
132
        """
130
133
        if format is None:
131
 
            basename = os.path.basename(filename)
 
134
            basename = bzrlib.osutils.basename(filename)
132
135
            if basename.startswith('callgrind.out'):
133
136
                format = "callgrind"
134
137
            else:
135
 
                ext = os.path.splitext(filename)[1]
 
138
                ext = bzrlib.osutils.splitext(filename)[1]
136
139
                if len(ext) > 1:
137
140
                    format = ext[1:]
138
141
        outfile = open(filename, 'wb')