diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 7610b0c05dd..ee249070c38 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2211,7 +2211,12 @@ sock_accept_impl(PySocketSockObject *s, void *data) #else ctx->result = accept(s->sock_fd, SAS2SA(ctx->addrbuf), ctx->addrlen); #endif + +#ifdef MS_WINDOWS + return (ctx->result != INVALID_SOCKET); +#else return (ctx->result >= 0); +#endif } /* s._accept() -> (fd, address) */