From 36ff358948fd2a0532e50eb97c6fe67fd8b7a618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Honza=20Kr=C3=A1l?= Date: Mon, 10 Feb 2014 18:14:39 +0100 Subject: [PATCH] Empty string should not be returned as None --- elasticsearch/transport.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/elasticsearch/transport.py b/elasticsearch/transport.py index 27eb7258..7a69c485 100644 --- a/elasticsearch/transport.py +++ b/elasticsearch/transport.py @@ -271,7 +271,7 @@ class Transport(object): connection = self.get_connection() try: - status, headers, raw_data = connection.perform_request(method, url, params, body, ignore=ignore) + status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore) except ConnectionError: self.mark_dead(connection) @@ -281,8 +281,7 @@ class Transport(object): else: # connection didn't fail, confirm it's live status self.connection_pool.mark_live(connection) - data = None - if raw_data: - data = self.deserializer.loads(raw_data, headers.get('content-type')) + if data: + data = self.deserializer.loads(data, headers.get('content-type')) return status, data