Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix gevent#204: os.tp_read/tp_write did not propogate errors to the c…
…aller
  • Loading branch information
denik committed Nov 20, 2012
1 parent 6be0754 commit 35b85c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gevent/os.py
Expand Up @@ -81,13 +81,13 @@ def tp_read(fd, n):
"""Read up to `n` bytes from file descriptor `fd`. Return a string
containing the bytes read. If end-of-file is reached, an empty string
is returned."""
return get_hub().threadpool.apply(_read, (fd, n))
return get_hub().threadpool.apply_e(BaseException, _read, (fd, n))


def tp_write(fd, buf):
"""Write bytes from buffer `buf` to file descriptor `fd`. Return the
number of bytes written."""
return get_hub().threadpool.apply(_write, (fd, buf))
return get_hub().threadpool.apply_e(BaseException, _write, (fd, buf))


if hasattr(os, 'fork'):
Expand Down

0 comments on commit 35b85c0

Please sign in to comment.