/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/library_state.py

  • Committer: Jelmer Vernooij
  • Date: 2019-08-11 13:21:03 UTC
  • mfrom: (7379 work)
  • mto: This revision was merged to the branch mainline in revision 7388.
  • Revision ID: jelmer@jelmer.uk-20190811132103-u3ne03yf37c1h57n
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    currently always exposed as breezy._global_state, but we desired to move
45
45
    to a point where no global state is needed at all.
46
46
 
47
 
    :ivar cleanups: An ObjectWithCleanups which can be used for cleanups that
 
47
    :ivar exit_stack: An ExitStack which can be used for cleanups that
48
48
        should occur when the use of breezy is completed. This is initialised
49
49
        in __enter__ and executed in __exit__.
50
50
    """
89
89
        # isolation within the same interpreter.  It's not reached on normal
90
90
        # in-process run_bzr calls.  If it's broken, we expect that
91
91
        # TestRunBzrSubprocess may fail.
92
 
        self.cleanups = cleanup.ObjectWithCleanups()
 
92
        self.exit_stack = cleanup.ExitStack()
93
93
 
94
94
        if breezy.version_info[3] == 'final':
95
 
            self.cleanups.add_cleanup(
 
95
            self.exit_stack.callback(
96
96
                symbol_versioning.suppress_deprecation_warnings(override=True))
97
97
 
98
98
        self._trace.__enter__()
111
111
            # Save config changes
112
112
            for k, store in self.config_stores.items():
113
113
                store.save_changes()
114
 
        self.cleanups.cleanup_now()
 
114
        self.exit_stack.close()
115
115
        trace._flush_stdout_stderr()
116
116
        trace._flush_trace()
117
117
        osutils.report_extension_load_failures()