From 735857008a1e35f6329dda229d459eb1229445f2 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 29 Nov 2012 09:35:30 -0500 Subject: [PATCH] api: Don't mutate the original request. This causes e.g. call_on_each_message to switch to dont_block mode after the first error. (imported from commit b6a5a10970c987faf8017f0ddae4e0b64a513c6f) --- api/common.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/common.py b/api/common.py index a785fdebdc..2ee9198b1d 100644 --- a/api/common.py +++ b/api/common.py @@ -54,14 +54,17 @@ class HumbugAPI(object): self.retry_on_errors = retry_on_errors self.client_name = client - def do_api_query(self, request, url, longpolling = False): + def do_api_query(self, orig_request, url, longpolling = False): + request = {} request["email"] = self.email request["api-key"] = self.api_key request["client"] = self.client_name - for (key, val) in request.iteritems(): + for (key, val) in orig_request.iteritems(): if not (isinstance(val, str) or isinstance(val, unicode)): request[key] = simplejson.dumps(val) + else: + request[key] = val query_state = { 'had_error_retry': False,