mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
Add socket.socket_type, as discussed on c.l.p.
This commit is contained in:
parent
05ba2ab720
commit
3b4b6fc602
1 changed files with 5 additions and 0 deletions
|
@ -1402,6 +1402,11 @@ initsocket()
|
||||||
if (PySocket_Error == NULL ||
|
if (PySocket_Error == NULL ||
|
||||||
PyDict_SetItemString(d, "error", PySocket_Error) != 0)
|
PyDict_SetItemString(d, "error", PySocket_Error) != 0)
|
||||||
Py_FatalError("can't define socket.error");
|
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);
|
insint(d, "AF_INET", AF_INET);
|
||||||
#ifdef AF_UNIX
|
#ifdef AF_UNIX
|
||||||
insint(d, "AF_UNIX", AF_UNIX);
|
insint(d, "AF_UNIX", AF_UNIX);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue