/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/mail_client.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:
172
172
            basename = 'attachment'
173
173
        pathname = osutils.mkdtemp(prefix='bzr-mail-')
174
174
        attach_path = osutils.pathjoin(pathname, basename + extension)
175
 
        outfile = open(attach_path, 'wb')
176
 
        try:
 
175
        with open(attach_path, 'wb') as outfile:
177
176
            outfile.write(attachment)
178
 
        finally:
179
 
            outfile.close()
180
177
        if body is not None:
181
178
            kwargs = {'body': body}
182
179
        else: