Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 2/3 compatibility, naming consistency #213

Merged
merged 2 commits into from
Sep 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ install:
- python setup.py install
- pip install pyyaml
- pip install flask
- pip install six
before_script:
- mkdir prism
- mkdir prism/bin
Expand Down
5 changes: 3 additions & 2 deletions sendgrid/helpers/inbound/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import base64
import email
import mimetypes
from six import iteritems
from werkzeug.utils import secure_filename


Expand Down Expand Up @@ -47,7 +48,7 @@ def attachments(self):

def _get_attachments(self, request):
attachments = []
for _, filestorage in request.files.iteritems():
for _, filestorage in iteritems(request.files):
attachment = {}
if filestorage.filename not in (None, 'fdopen', '<fdopen>'):
filename = secure_filename(filestorage.filename)
Expand All @@ -72,7 +73,7 @@ def _get_attachments_raw(self, raw_email):
filename = 'part-%03d%s' % (counter, ext)
counter += 1
attachment['type'] = part.get_content_type()
attachment['filename'] = filename
attachment['file_name'] = filename
attachment['contents'] = part.get_payload(decode=False)
attachments.append(attachment)
return attachments
Expand Down