If fd is -1 in pysock_op_iternext just return None.

None in pysock signals EOF and if it was closed under our feet we should
relay that properly.
This commit is contained in:
Joris Vink 2019-03-21 14:44:41 +01:00
parent 370041656e
commit 58c2739dee
1 changed files with 5 additions and 0 deletions

View File

@ -2066,6 +2066,11 @@ pysocket_op_iternext(struct pysocket_op *op)
{
PyObject *ret;
if (op->socket->fd == -1) {
PyErr_SetNone(PyExc_StopIteration);
return (NULL);
}
if (op->eof) {
if (op->coro->exception != NULL) {
PyErr_SetString(op->coro->exception,