/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/tests/test_version_info.py

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 19:18:40 UTC
  • mto: This revision was merged to the branch mainline in revision 6928.
  • Revision ID: jelmer@jelmer.uk-20180218191840-2wezg20u9ffbfmed
Fix more bees, use with rather than try/finally for some files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
261
261
 
262
262
    def regen(self, wt, **kwargs):
263
263
        """Create a test module, import and return it"""
264
 
        outf = open('test_version_information.py', 'wb')
265
 
        try:
 
264
        with open('test_version_information.py', 'wb') as outf:
266
265
            builder = PythonVersionInfoBuilder(wt.branch, working_tree=wt,
267
266
                                               **kwargs)
268
267
            builder.generate(outf)
269
 
        finally:
270
 
            outf.close()
271
268
        import imp
272
269
        module_info = imp.find_module('test_version_information',
273
270
                                      [self.test_dir])