Skip to content

Commit 52d6fe9

Browse files
pylint: fix no-else-raise cases
Fix all cases of R1720 no-else-raise. Part of #270
1 parent b1c8b7e commit 52d6fe9

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

tarantool/connection.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,15 +1114,15 @@ def _recv(self, to_read):
11141114
"Lost connection to server during query"
11151115
)
11161116
raise NetworkError(err) from exc
1117-
else:
1118-
if len(tmp) == 0:
1119-
err = socket.error(
1120-
errno.ECONNRESET,
1121-
"Lost connection to server during query"
1122-
)
1123-
raise NetworkError(err)
1124-
to_read -= len(tmp)
1125-
buf += tmp
1117+
1118+
if len(tmp) == 0:
1119+
err = socket.error(
1120+
errno.ECONNRESET,
1121+
"Lost connection to server during query"
1122+
)
1123+
raise NetworkError(err)
1124+
to_read -= len(tmp)
1125+
buf += tmp
11261126
return buf
11271127

11281128
def _read_response(self):

tarantool/schema.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def fetch_space(self, space):
240240
raise SchemaError(
241241
'Some strange output from server: \n' + str(space_row)
242242
)
243-
elif len(space_row) == 0 or not space_row[0]:
243+
if len(space_row) == 0 or not space_row[0]:
244244
# We can't find space with this name or id
245245
temp_name = 'name' if isinstance(space, str) else 'id'
246246
errmsg = f"There's no space with {temp_name} '{space}'"
@@ -352,7 +352,7 @@ def fetch_index(self, space_object, index):
352352
raise SchemaError(
353353
'Some strange output from server: \n' + str(index_row)
354354
)
355-
elif len(index_row) == 0 or not index_row[0]:
355+
if len(index_row) == 0 or not index_row[0]:
356356
# We can't find index with this name or id
357357
temp_name = 'name' if isinstance(index, str) else 'id'
358358
errmsg = (f"There's no index with {temp_name} '{index}'"

0 commit comments

Comments
 (0)