]> granicus.if.org Git - python/commitdiff
Add socket.socket_type, as discussed on c.l.p.
authorGuido van Rossum <guido@python.org>
Wed, 21 May 1997 14:37:37 +0000 (14:37 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 21 May 1997 14:37:37 +0000 (14:37 +0000)
Modules/socketmodule.c

index 52aca5634655e84f174c472d42ff1e0a9e2ee21a..78c0d896c376824ccad59729de14c4a4e6814f73 100644 (file)
@@ -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);