From a02471e027e2298384169a5152fdf9178823867d Mon Sep 17 00:00:00 2001 From: Denis Ignatenko Date: Mon, 10 Jun 2019 13:28:43 +0300 Subject: [PATCH] Fix response obj string repr in case of no data For example an Connection::authenticate() response does no contain a data. This leads to an exception when working with the connection from interactive python console. Fixes #139. --- tarantool/response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tarantool/response.py b/tarantool/response.py index 7b8a5636..9516cd39 100644 --- a/tarantool/response.py +++ b/tarantool/response.py @@ -238,7 +238,7 @@ def __str__(self): } }, sort_keys = True, indent = 4) output = [] - for tpl in self._data: + for tpl in self._data or (): output.extend(("- ", repr(tpl), "\n")) if len(output) > 0: output.pop()