Skip to content

Commit 08fab7a

Browse files
committed
Don't make changes to mutable default argument.
1 parent df7dce4 commit 08fab7a

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎Cryptsy.py‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ def api_query(self, method, req={}):
3434
ret = urllib2.urlopen(urllib2.Request('http://pubapi.cryptsy.com/api.php?method=' + method + '&marketid=' + str(req['marketid'])))
3535
return json.loads(ret.read())
3636
else:
37-
req['method'] = method
38-
req['nonce'] = int(time.time())
39-
post_data = urllib.urlencode(req)
37+
urlreq = dict(req)
38+
urlreq['method'] = method
39+
urlreq['nonce'] = int(time.time())
40+
post_data = urllib.urlencode(urlreq)
4041

4142
sign = hmac.new(self.Secret, post_data, hashlib.sha512).hexdigest()
4243
headers = {

0 commit comments

Comments
 (0)