Skip to content

Commit e012991

Browse files
committed
Empty string should not be returned as None
1 parent 59d86ac commit e012991

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

elasticsearch/transport.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def perform_request(self, method, url, params=None, body=None):
271271
connection = self.get_connection()
272272

273273
try:
274-
status, headers, raw_data = connection.perform_request(method, url, params, body, ignore=ignore)
274+
status, headers, data = connection.perform_request(method, url, params, body, ignore=ignore)
275275
except ConnectionError:
276276
self.mark_dead(connection)
277277

@@ -281,8 +281,7 @@ def perform_request(self, method, url, params=None, body=None):
281281
else:
282282
# connection didn't fail, confirm it's live status
283283
self.connection_pool.mark_live(connection)
284-
data = None
285-
if raw_data:
286-
data = self.deserializer.loads(raw_data, headers.get('content-type'))
284+
if data:
285+
data = self.deserializer.loads(data, headers.get('content-type'))
287286
return status, data
288287

0 commit comments

Comments
 (0)