~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-10-25 08:29:08 UTC
  • mfrom: (2940.1.2 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20071025082908-abn3kunrb2ivdvth
renaming of experimental pack formats to include knitpack in their name (Ian Clatworthy)

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')