On Fri, Aug 11, 2000 at 10:33:35AM -0400, Andrew Kuchling wrote: > On Fri, Aug 11, 2000 at 04:21:09PM +0200, Thomas Wouters wrote: > >Someone set the patch to 'rejected' and tell the submittor that 'send' > >doesn't return the number of bytes written ;-P > What about reviving the idea of raising an exception, then? static PyObject * PySocketSock_send(PySocketSockObject *s, PyObject *args) { char *buf; int len, n, flags = 0; if (!PyArg_ParseTuple(args, "s#|i:send", &buf, &len, &flags)) return NULL; Py_BEGIN_ALLOW_THREADS n = send(s->sock_fd, buf, len, flags); Py_END_ALLOW_THREADS if (n < 0) return PySocket_Err(); return PyInt_FromLong((long)n); } (PySocket_Err() creates an error.) -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4