My favorites | Sign in
Project Home
New issue   Search
for
  Advanced search   Search tips   Subscriptions

Issue 147 attachment: isclosed.diff (647 bytes)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--- couchdb/http.py 2010-09-19 09:17:32.000000000 -0500
+++ /home/amoore/dev/couchdb-python/couchdb/http.py 2010-08-31 10:03:16.000000000 -0500
@@ -92,15 +92,13 @@

def read(self, size=None):
bytes = self.resp.read(size)
- if bytes is None or len(bytes) < size:
+ if size is None or len(bytes) < size:
self.close()
- return False
return bytes

def close(self):
- while True:
- if ( self.read(CHUNK_SIZE) is False ):
- break
+ while not self.resp.isclosed():
+ self.read(CHUNK_SIZE)
self.callback()

def __iter__(self):
Powered by Google Project Hosting