Commits

Stefano Rivera committed 71219b3

Catch EAGAIN in BufferingInputStream.read()

Comments (0)

Files changed (1)

pypy/rlib/streamio.py

         else:
             chunks = [self.buf[start:]]
             while 1:
-                self.buf = self.do_read(self.bufsize)
+                try:
+                    self.buf = self.do_read(self.bufsize)
+                except OSError, o:
+                    if o.errno != errno.EAGAIN:
+                        raise
+                    if chunks == ['']:
+                        raise
+                    self.buf = ''
                 if not self.buf:
                     self.pos = 0
                     break