From cc1b087c1069297f3853003172b89c762b185b23 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Thu, 23 Aug 2012 09:56:53 -0700 Subject: [PATCH] CloudSearch: Fix AttributeError when record_stats = False. While the stub-timer I introduced earlier takes care of some issues, it doesn't take care of when we explicitly set the variable to None! --- r2/r2/lib/cloudsearch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r2/r2/lib/cloudsearch.py b/r2/r2/lib/cloudsearch.py index 2bbe50b49..824b43b68 100644 --- a/r2/r2/lib/cloudsearch.py +++ b/r2/r2/lib/cloudsearch.py @@ -550,7 +550,8 @@ def basic_query(query=None, bq=None, faceting=None, size=1000, response) finally: connection.close() - timer.stop() + if timer is not None: + timer.stop() return json.loads(response)