Skip to content

Commit 2ed1225

Browse files
committed
moved urlib.parse.unquote from auth to compat
1 parent 191754c commit 2ed1225

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

cryptomarket/exchange/auth.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from __future__ import unicode_literals
66

77
import hashlib
8-
import urllib
98
import hmac
109
import json
1110
import time
@@ -14,7 +13,9 @@
1413
from requests.utils import to_native_string
1514

1615
#same folder
17-
from .compat import urljoin, urlparse
16+
from .compat import unquote
17+
from .compat import urljoin
18+
from .compat import urlparse
1819

1920

2021
class HMACAuth(AuthBase):
@@ -35,7 +36,7 @@ def __call__(self, request):
3536
body += str(params[key])
3637

3738
timestamp = str(int(time.time()))
38-
message = timestamp + urllib.parse.unquote(urljoin(request.path_url, urlparse(request.path_url).path) + body)
39+
message = timestamp + unquote(urljoin(request.path_url, urlparse(request.path_url).path) + body)
3940
secret = self.api_secret
4041

4142
if not isinstance(message, bytes):

cryptomarket/exchange/compat.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
if six.PY2:
44
from itertools import imap
55
from urllib import quote
6+
from urllib import unquote
67
from urllib import urlencode
78
from urlparse import urljoin
89
from urlparse import urlparse
910
elif six.PY3:
1011
imap = map
12+
from urllib.parse import unquote
1113
from urllib.parse import quote
1214
from urllib.parse import urljoin
1315
from urllib.parse import urlparse

0 commit comments

Comments
 (0)