Skip to content

Commit 71b1bb4

Browse files
committed
Make urlencode import Python 2/3 compatible
1 parent 98b2e49 commit 71b1bb4

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
@@ -14,7 +14,13 @@
1414

1515
import urllib2
1616

17-
from urllib import urlencode
17+
try:
18+
# Python 3
19+
from urllib.parse import urlencode
20+
except ImportError:
21+
# Python 2
22+
from urllib import urlencode
23+
1824
from StringIO import StringIO
1925
import json as json_lib
2026
import re

0 commit comments

Comments
 (0)