[pypy-svn] r45461 - pypy/dist/pypy/translator/sandbox
arigo at codespeak.net
arigo at codespeak.net
Thu Aug 2 19:16:23 CEST 2007
Author: arigo
Date: Thu Aug 2 19:16:23 2007
New Revision: 45461
Modified:
pypy/dist/pypy/translator/sandbox/rsandbox.py
Log:
Cannot use EOFError here. If the original program didn't use it already,
then it's a new Exception subclass and normalizecalls is unhappy.
Modified: pypy/dist/pypy/translator/sandbox/rsandbox.py
==============================================================================
--- pypy/dist/pypy/translator/sandbox/rsandbox.py (original)
+++ pypy/dist/pypy/translator/sandbox/rsandbox.py Thu Aug 2 19:16:23 2007
@@ -38,10 +38,8 @@
while length > 0:
size = rffi.cast(rffi.SIZE_T, length)
count = rffi.cast(lltype.Signed, ll_write_not_sandboxed(fd, buf, size))
- if count < 0:
+ if count <= 0:
raise IOError
- if count == 0:
- raise EOFError
length -= count
buf = lltype.direct_ptradd(lltype.direct_arrayitems(buf), count)
buf = rffi.cast(rffi.CCHARP, buf)
@@ -53,10 +51,8 @@
while got < length:
size1 = rffi.cast(rffi.SIZE_T, length - got)
count = rffi.cast(lltype.Signed, ll_read_not_sandboxed(fd, p, size1))
- if count < 0:
+ if count <= 0:
raise IOError
- if count == 0:
- raise EOFError
got += count
p = lltype.direct_ptradd(lltype.direct_arrayitems(p), count)
p = rffi.cast(rffi.CCHARP, p)
More information about the Pypy-commit
mailing list