Skip to content

Commit 21dde65

Browse files
committed
Make StringIO import Python 2/3 compatible
1 parent caef8d3 commit 21dde65

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Adyen/httpclient.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
from urllib import urlencode
2323
from urllib2 import Request, urlopen, HTTPError
2424

25-
from StringIO import StringIO
25+
try:
26+
# Python 3
27+
from io import StringIO
28+
except ImportError:
29+
# Python 2
30+
from StringIO import StringIO
31+
2632
import json as json_lib
2733
import re
2834
import base64

0 commit comments

Comments
 (0)