ненужные перестраховки

sandbox1
inpos 2016-03-12 00:29:09 +03:00
parent 8ea64f3cd3
commit 312da87172
1 changed files with 3 additions and 3 deletions

View File

@ -309,9 +309,9 @@ class Engine:
res = self.list(timeout=timeout)
if res:
try:
return next((f for f in res if f.index == file_index))
except StopIteration:
raise Error("Requested file index (%d) is invalid" % file_index, Error.INVALID_FILE_INDEX,
return res[file_index]
except IndexError:
raise Error("Requested file index (%d) is invalid" % (file_index,), Error.INVALID_FILE_INDEX,
file_index=file_index)
def peers(self, timeout=10):