From 1123d43b1a7de280f8bae2852b54ab0e25b7d877 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 29 Mar 2013 11:08:24 -0400 Subject: [PATCH] event_queue: Add requests 1.x compatibility. The previous version of our code only worked with python-requests < 1.0 (as is the case on our servers), the new version will work with any python-requests new enough to have a .json at all. (imported from commit 77ffe3e0d890fe88776c313e0e3289aee1bb30ea) --- humbug/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/humbug/__init__.py b/humbug/__init__.py index 7d6d341..e68438e 100644 --- a/humbug/__init__.py +++ b/humbug/__init__.py @@ -39,7 +39,7 @@ __version__ = "0.1.5" # Older versions don't provide the 'json' attribute on responses. assert(LooseVersion(requests.__version__) >= LooseVersion('0.12.1')) # In newer versions, the 'json' attribute is a function, not a property -requests_json_is_function = not isinstance(requests.Response.json, property) +requests_json_is_function = callable(requests.Response.json) API_VERSTRING = "/api/v1/"