~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lazy_import.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-06 00:38:46 UTC
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061006003846-b447b3dda0c17ce2
make lazy_import lazily import errors

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
This includes waiting to import a module until it is actually used.
20
20
"""
21
21
 
22
 
from bzrlib import (
23
 
    errors,
24
 
    )
25
 
 
26
22
 
27
23
class ScopeReplacer(object):
28
24
    """A lazy object that will replace itself in the appropriate scope.
349
345
    # This is just a helper around ImportProcessor.lazy_import
350
346
    proc = ImportProcessor(lazy_import_class=lazy_import_class)
351
347
    return proc.lazy_import(scope, text)
 
348
 
 
349
 
 
350
# The only module that this module depends on is 'bzrlib.errors'. But it
 
351
# can actually be imported lazily, since we only need it if there is a
 
352
# problem.
 
353
 
 
354
lazy_import(globals(), """
 
355
from bzrlib import errors
 
356
""")