Skip to content

Commit 8647e15

Browse files
committed
Just do the encode
1 parent 6beb2dd commit 8647e15

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

sendgrid/transport/web.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ def send(self, message):
8585

8686
for key in optional_params:
8787
if optional_params[key]:
88-
val = optional_params[key]
89-
if isinstance(val, unicode):
90-
data[key] = val.encode('utf-8')
91-
elif isinstance(val, str):
92-
data[key] = val.decode('utf-8')
88+
data[key] = optional_params[key]
89+
if isinstance(data[key], unicode):
90+
data[key] = data[key].encode('utf-8')
9391

9492
data = urllib.urlencode(data, 1)
9593
req = urllib2.Request(url, data)

0 commit comments

Comments
 (0)