From: Guido van Rossum Date: Wed, 21 May 1997 14:37:37 +0000 (+0000) Subject: Add socket.socket_type, as discussed on c.l.p. X-Git-Tag: v1.5a3~506 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3b4b6fc602402058ece0506ee8dab5c46ec39adc;p=python Add socket.socket_type, as discussed on c.l.p. --- diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 52aca56346..78c0d896c3 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -1402,6 +1402,11 @@ initsocket() if (PySocket_Error == NULL || PyDict_SetItemString(d, "error", PySocket_Error) != 0) Py_FatalError("can't define socket.error"); + PySocketSock_Type.ob_type = &PyType_Type; + Py_INCREF(&PySocketSock_Type); + if (PyDict_SetItemString(d, "socket_type", + (PyObject *)&PySocketSock_Type) != 0) + Py_FatalError("can't define socket.socket_type"); insint(d, "AF_INET", AF_INET); #ifdef AF_UNIX insint(d, "AF_UNIX", AF_UNIX);