Skip to content

Commit

Permalink
io module is present in Python 2.6
Browse files Browse the repository at this point in the history
First import for `StringIO` must be from `io` module because this is the future. Fallback from `cStringIO` and finally from `StringIO` must be for Python 2.5 compatibility. If Python 2.5 is not supported then this `try .. except` block must be removed and only the import from `io` module should be left here.
  • Loading branch information
vstoykov committed May 30, 2014
1 parent 9c4b03c commit 562f346
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions django_mailgun/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from django.core.mail.message import sanitize_address

try:
from cStringIO import StringIO
from io import StringIO
except ImportError:
try:
from StringIO import StringIO
from cStringIO import StringIO
except ImportError:
from io import StringIO
from StringIO import StringIO

class MailgunAPIError(Exception):
pass
Expand Down

0 comments on commit 562f346

Please sign in to comment.