summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paramiko/sftp_file.py4
-rw-r--r--tests/test_sftp_big.py2
2 files changed, 2 insertions, 4 deletions
diff --git a/paramiko/sftp_file.py b/paramiko/sftp_file.py
index 17f999e7..28879861 100644
--- a/paramiko/sftp_file.py
+++ b/paramiko/sftp_file.py
@@ -388,11 +388,9 @@ class SFTPFile (BufferedFile):
ordered_chunks.sort(lambda x, y: cmp(x[0], y[0]))
self._start_prefetch(ordered_chunks)
# now we can just devolve to a bunch of read()s :)
- out = []
for x in chunks:
self.seek(x[0])
- out.append(self.read(x[1]))
- return out
+ yield self.read(x[1])
### internals...
diff --git a/tests/test_sftp_big.py b/tests/test_sftp_big.py
index aefe3ef3..94edab02 100644
--- a/tests/test_sftp_big.py
+++ b/tests/test_sftp_big.py
@@ -232,7 +232,7 @@ class BigSFTPTest (unittest.TestCase):
for i in xrange(len(readv_list)):
offset = readv_list[i][0]
n_offset = offset % 1024
- self.assertEqual(ret[i], k2blob[n_offset:n_offset + chunk])
+ self.assertEqual(ret.next(), k2blob[n_offset:n_offset + chunk])
f.close()
end = time.time()
sys.stderr.write('%ds ' % round(end - start))