Skip to content

Commit 15f036e

Browse files
committed
Small conditional clean-up
The conditional under revision does the same thing for two of three cases. I just got rid of their separation.
1 parent 64eaec3 commit 15f036e

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
@@ -128,11 +128,9 @@ def add_attachment(self, name, file_):
128128
def add_attachment_stream(self, name, string):
129129
if sys.version_info < (3, 0) and isinstance(name, unicode):
130130
name = name.encode('utf-8')
131-
if isinstance(string, str):
132-
self.files[name] = string
133-
elif isinstance(string, io.BytesIO):
131+
if isinstance(string, io.BytesIO):
134132
self.files[name] = string.read()
135-
elif sys.version_info < (3, 0) and isinstance(string, unicode):
133+
else:
136134
self.files[name] = string
137135

138136
def add_content_id(self, cid, value):

0 commit comments

Comments
 (0)