Skip to content

Commit b72c918

Browse files
author
Yamil Asusta
committed
Merge pull request #88 from cbg/small_conditional_fix
Small conditional clean-up
2 parents 4753edc + 15f036e commit b72c918

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

sendgrid/message.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,9 @@ def add_attachment(self, name, file_):
131131
def add_attachment_stream(self, name, string):
132132
if sys.version_info < (3, 0) and isinstance(name, unicode):
133133
name = name.encode('utf-8')
134-
if isinstance(string, str):
135-
self.files[name] = string
136-
elif isinstance(string, io.BytesIO):
134+
if isinstance(string, io.BytesIO):
137135
self.files[name] = string.read()
138-
elif sys.version_info < (3, 0) and isinstance(string, unicode):
136+
else:
139137
self.files[name] = string
140138

141139
def add_content_id(self, cid, value):

0 commit comments

Comments
 (0)