Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

squash resource warning on python 3.2

  • Loading branch information...
commit 97eeef4d392fcc22b368e1eacf24e9c5f5feed94 1 parent 95ff3e7
@mcdonc mcdonc authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 pyramid_mailer/response.py
View
4 pyramid_mailer/response.py
@@ -248,7 +248,9 @@ def _encode_attachment(self, filename=None, content_type=None, data=None,
self.base.parts.append(part)
elif filename:
if not data:
- data = open(filename).read()
+ f = open(filename)
+ data = f.read()
+ f.close()
self.base.attach_file(filename, data, content_type,
disposition or 'attachment')
Please sign in to comment.
Something went wrong with that request. Please try again.