~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-06-21 21:59:53 UTC
  • mfrom: (5311.1.1 contextmanagers)
  • Revision ID: pqm@pqm.ubuntu.com-20100621215953-vfo3e4ubs1gjc6ez
(lifeless) Return self from the new context managers so that new objects
 used with with statements are usable. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
        Override in a concrete factory class if initialisation before use is
133
133
        needed.
134
134
        """
 
135
        return self # This is bound to the 'as' clause in a with statement.
135
136
 
136
137
    def __exit__(self, exc_type, exc_val, exc_tb):
137
138
        """Context manager exit support.