Skip to content

Commit 7523485

Browse files
committed
SDK-1076: Update http module to try importing urllib first, then urlparse for python 2.7 support
1 parent 352e40a commit 7523485

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

yoti_python_sdk/http.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
JSON_CONTENT_TYPE,
99
)
1010
from cryptography.fernet import base64
11-
from urllib.parse import urlencode
1211

1312
import yoti_python_sdk
1413
import requests
1514
import uuid
1615
import time
1716

17+
try:
18+
from urllib.parse import urlencode
19+
except ImportError:
20+
from urlparse import urlencode
21+
1822
HTTP_POST = "POST"
1923
HTTP_GET = "GET"
2024
HTTP_SUPPORTED_METHODS = ["POST", "PUT", "PATCH", "GET", "DELETE"]

0 commit comments

Comments
 (0)