~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to profile_imports.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-12 20:10:32 UTC
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20060912201032-0bd76e7736ebf2f1
Make profile_imports aware of lazy_import stuff

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
    frame = sys._getframe(1)
116
116
    frame_name = frame.f_globals.get('__name__', '<unknown>')
117
117
    extra = ''
118
 
    cur_frame = 1
119
118
    if frame_name.endswith('demandload'):
120
119
        # If this was demandloaded, we have 3 frames to ignore
121
120
        extra = ' (demandload)'
122
121
        frame = sys._getframe(4)
123
 
        cur_frame = 4
 
122
        frame_name = frame.f_globals.get('__name__', '<unknown>')
 
123
    elif frame_name.endswith('lazy_import'):
 
124
        # If this was lazily imported, we have 3 frames to ignore
 
125
        extra = ' (lazy)'
 
126
        frame = sys._getframe(4)
124
127
        frame_name = frame.f_globals.get('__name__', '<unknown>')
125
128
    frame_lineno = frame.f_lineno
126
129