1. Stefano Rivera
  2. pypy

Commits

Stefano Rivera  committed 52f9fa5

Catch EAGAIN in W_File.direct_read()

  • Participants
  • Parent commits ca15c5b
  • Branches default

Comments (0)

Files changed (1)

File pypy/module/_file/interp_file.py

View file
  • Ignore whitespace
         else:
             result = StringBuilder(n)
             while n > 0:
-                data = stream.read(n)
+                try:
+                    data = stream.read(n)
+                except OSError, e:
+                    if e.errno != errno.EAGAIN:
+                        raise
+                    if not result.getlength():
+                        raise
+                    data = ''
                 if not data:
                     break
                 n -= len(data)