/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/export/dir_exporter.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:
82
82
        mode = 0o666
83
83
        if tree.is_executable(treepath, file_id):
84
84
            mode = 0o777
85
 
        out = os.fdopen(os.open(fullpath, flags, mode), 'wb')
86
 
        try:
 
85
        with os.fdopen(os.open(fullpath, flags, mode), 'wb') as out:
87
86
            out.writelines(chunks)
88
 
        finally:
89
 
            out.close()
90
87
        if force_mtime is not None:
91
88
            mtime = force_mtime
92
89
        else: