~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lsprof.py

  • Committer: Andrew Bennetts
  • Date: 2008-07-28 06:53:44 UTC
  • mfrom: (3581 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3583.
  • Revision ID: andrew.bennetts@canonical.com-20080728065344-ocndjoycs903q6fz
Merge bzr.dev.

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
 
 
17
14
__all__ = ['profile', 'Stats']
18
15
 
19
16
_g_threadmap = {}
131
128
            otherwise the format is given by the filename extension.
132
129
        """
133
130
        if format is None:
134
 
            basename = bzrlib.osutils.basename(filename)
 
131
            basename = os.path.basename(filename)
135
132
            if basename.startswith('callgrind.out'):
136
133
                format = "callgrind"
137
134
            else:
138
 
                ext = bzrlib.osutils.splitext(filename)[1]
 
135
                ext = os.path.splitext(filename)[1]
139
136
                if len(ext) > 1:
140
137
                    format = ext[1:]
141
138
        outfile = open(filename, 'wb')