re-import lsprof.py

Robey Pointer robey at lag.net
Mon Aug 14 19:17:37 BST 2006


On 12 Aug 2006, at 11:29, Carl Friedrich Bolz wrote:

> Hi all!
>
> The lsprof.py that is included in bzr lags quite a big behind between
> the original file. Is it possible to re-import it? It crashes  
> because of
> things that I have in my site.py and this particular bug has been  
> fixed
> in the official version. The newest version can be found here:
>
> http://codespeak.net/svn/user/arigo/hack/misc/lsprof/

Thanks for finding this, btw!  I was looking for lsprof about a month  
ago for a friend and couldn't find it.  I was afraid it had become  
abandonware.

In addition to John's comments, I want to add: It's not clear to me  
if cProfile supports threads -- a quick skim looks like it doesn't.   
I'll try to contact Armin and see if they'd like to merge some of our  
changes too.


On 14 Aug 2006, at 6:31, John Arbash Meinel wrote:
>
>> --------------------------------------------------------------------- 
>> ---
>>
>> === modified file 'bzrlib/lsprof.py'
>> --- bzrlib/lsprof.py	2006-07-01 19:03:33 +0000
>> +++ bzrlib/lsprof.py	2006-08-14 10:28:40 +0000
>> @@ -162,7 +162,7 @@
>>      try:
>>          mname = _fn2mod[code.co_filename]
>>      except KeyError:
>> -        for k, v in sys.modules.iteritems():
>> +        for k, v in sys.modules.items():
>>              if v is None:
>>                  continue
>>              if not hasattr(v, '__file__'):
>>
>
> In the mean time, if this is a reasonable fix, +1 from me. Anyone  
> else?

+1 from me too.

robey





More information about the bazaar mailing list