~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lazy_import.py

  • Committer: Patch Queue Manager
  • Date: 2011-12-19 13:30:31 UTC
  • mfrom: (6355.2.5 absolute-lazy-import)
  • Revision ID: pqm@pqm.ubuntu.com-20111219133031-97tc08321g9zz6dd
(jelmer) Only allow absolute imports using lazy_import. (Jelmer Vernooij)

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
        module_path = object.__getattribute__(self, '_module_path')
209
209
        module_python_path = '.'.join(module_path)
210
210
        if member is not None:
211
 
            module = __import__(module_python_path, scope, scope, [member])
 
211
            module = __import__(module_python_path, scope, scope, [member], level=0)
212
212
            return getattr(module, member)
213
213
        else:
214
 
            module = __import__(module_python_path, scope, scope, [])
 
214
            module = __import__(module_python_path, scope, scope, [], level=0)
215
215
            for path in module_path[1:]:
216
216
                module = getattr(module, path)
217
217