SendGrid: convert long to str in headers, metadata

SendGrid requires extra headers and metadata values be strings.
Anymail has always coerced int and float; this treats Python 2's
`long` integer type the same.

Fixes #74
This commit is contained in:
medmunds
2017-09-14 11:45:17 -07:00
parent 168d46a254
commit 3b9cb963ef
5 changed files with 25 additions and 9 deletions

View File

@@ -18,6 +18,10 @@ from six.moves.urllib.parse import urlsplit, urlunsplit
from .exceptions import AnymailConfigurationError, AnymailInvalidAddress
BASIC_NUMERIC_TYPES = six.integer_types + (float,) # int, float, and (on Python 2) long
UNSET = object() # Used as non-None default value