~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to profile_imports.py

  • Committer: Martin Pool
  • Date: 2009-11-14 11:43:23 UTC
  • mto: This revision was merged to the branch mainline in revision 5012.
  • Revision ID: mbp@sourcefrog.net-20091114114323-cwqx8nwj2o6nvzsm
Fix --profile-imports for python2.6 import hook parameters

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
 
97
97
_real_import = __import__
98
98
 
99
 
def timed_import(name, globals, locals, fromlist):
 
99
def timed_import(name, globals, locals, fromlist, level=None):
100
100
    """Wrap around standard importer to log import time"""
 
101
    # level is only passed by python2.6
101
102
 
102
103
    scope_name = globals.get('__name__', None)
103
104
    if scope_name is None: