From 08fab7a54a1d581c43ebc03755f7ac859ba17e1e Mon Sep 17 00:00:00 2001 From: penner42 Date: Thu, 6 Feb 2014 11:26:09 -0800 Subject: [PATCH] Don't make changes to mutable default argument. --- Cryptsy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cryptsy.py b/Cryptsy.py index 73f1112..3c663e6 100644 --- a/Cryptsy.py +++ b/Cryptsy.py @@ -34,9 +34,10 @@ def api_query(self, method, req={}): ret = urllib2.urlopen(urllib2.Request('http://pubapi.cryptsy.com/api.php?method=' + method + '&marketid=' + str(req['marketid']))) return json.loads(ret.read()) else: - req['method'] = method - req['nonce'] = int(time.time()) - post_data = urllib.urlencode(req) + urlreq = dict(req) + urlreq['method'] = method + urlreq['nonce'] = int(time.time()) + post_data = urllib.urlencode(urlreq) sign = hmac.new(self.Secret, post_data, hashlib.sha512).hexdigest() headers = {