diff options
| author | Jesse Noller <jnoller@gmail.com> | 2009-04-02 04:22:09 (GMT) |
|---|---|---|
| committer | Jesse Noller <jnoller@gmail.com> | 2009-04-02 04:22:09 (GMT) |
| commit | 5053fbbb38b7b8bc8207e2d27c32c7b82ce3172f (patch) | |
| tree | 530d74ee5a347857bd40d4f3fb559cc716bdb913 /Modules/_multiprocessing/pipe_connection.c | |
| parent | 238cedcd6339e747daa6e2a383678d893482ef6d (diff) | |
| download | cpython-5053fbbb38b7b8bc8207e2d27c32c7b82ce3172f.zip cpython-5053fbbb38b7b8bc8207e2d27c32c7b82ce3172f.tar.gz cpython-5053fbbb38b7b8bc8207e2d27c32c7b82ce3172f.tar.bz2 | |
Issue 3551: Raise ValueError if the size causes ERROR_NO_SYSTEM_RESOURCES
Diffstat (limited to 'Modules/_multiprocessing/pipe_connection.c')
| -rw-r--r-- | Modules/_multiprocessing/pipe_connection.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/_multiprocessing/pipe_connection.c b/Modules/_multiprocessing/pipe_connection.c index 27e79dd..66947c8 100644 --- a/Modules/_multiprocessing/pipe_connection.c +++ b/Modules/_multiprocessing/pipe_connection.c @@ -23,6 +23,12 @@ conn_send_string(ConnectionObject *conn, char *string, size_t length) Py_BEGIN_ALLOW_THREADS ret = WriteFile(conn->handle, string, length, &amount_written, NULL); Py_END_ALLOW_THREADS + + if (ret == 0 && GetLastError() == ERROR_NO_SYSTEM_RESOURCES) { + PyErr_Format(PyExc_ValueError, "Cannnot send %" PY_FORMAT_SIZE_T "d bytes over connection", length); + return MP_STANDARD_ERROR; + } + return ret ? MP_SUCCESS : MP_STANDARD_ERROR; } |
