Changeset: 52f391796452 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=52f391796452
Modified Files:
        python/monetdb/mapi2.py
Branch: default
Log Message:

replaced error check with an actual fix


diffs (28 lines):

diff -r 3135505afb9c -r 52f391796452 python/monetdb/mapi2.py
--- a/python/monetdb/mapi2.py   Thu May 13 13:44:18 2010 +0200
+++ b/python/monetdb/mapi2.py   Thu May 13 14:20:12 2010 +0200
@@ -230,14 +230,16 @@
 
     def __getbytes(self, bytes):
         """Read an amount of bytes from the socket"""
-        try:
-            recv = self.socket.recv(bytes)
-            if len(recv) != bytes:
-                raise OperationalError("expected %s bytes but received %s 
bytes" % bytes, len(recv))
-            return recv
-        except socket.error, error:
-            raise OperationalError(error[1])
-
+        count = bytes
+        result = ""
+        while count > 0:
+            try:
+                recv = self.socket.recv(bytes)
+            except socket.error, error:
+                raise OperationalError(error[1])
+            count -= len(recv)
+            result += recv
+        return result
 
     def __putblock(self, block):
         """ wrap the line in mapi format and put it into the socket """
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to