|
35 | 35 | error -- exception raised for I/O errors |
36 | 36 | has_ipv6 -- boolean value indicating if IPv6 is supported |
37 | 37 |
|
38 | | -Integer constants: |
| 38 | +IntEnum constants: |
39 | 39 |
|
40 | 40 | AF_INET, AF_UNIX -- socket domains (first argument to socket() call) |
41 | 41 | SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument) |
42 | 42 |
|
| 43 | +Integer constants: |
| 44 | +
|
43 | 45 | Many other constants may be defined; these may be used in calls to |
44 | 46 | the setsockopt() and getsockopt() methods. |
45 | 47 | """ |
|
71 | 73 | if name.isupper() and name.startswith('AF_')}) |
72 | 74 | globals().update(AddressFamily.__members__) |
73 | 75 |
|
74 | | -SocketType = IntEnum('SocketType', |
| 76 | +SocketKind = IntEnum('SocketKind', |
75 | 77 | {name: value for name, value in globals().items() |
76 | 78 | if name.isupper() and name.startswith('SOCK_')}) |
77 | | -globals().update(SocketType.__members__) |
| 79 | +globals().update(SocketKind.__members__) |
78 | 80 |
|
79 | 81 |
|
80 | 82 | _LOCALHOST = '127.0.0.1' |
@@ -420,7 +422,7 @@ def family(self): |
420 | 422 | def type(self): |
421 | 423 | """Read-only access to the socket type. |
422 | 424 | """ |
423 | | - return _intenum_converter(super().type, SocketType) |
| 425 | + return _intenum_converter(super().type, SocketKind) |
424 | 426 |
|
425 | 427 | if os.name == 'nt': |
426 | 428 | def get_inheritable(self): |
@@ -727,6 +729,6 @@ def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0): |
727 | 729 | for res in _socket.getaddrinfo(host, port, family, type, proto, flags): |
728 | 730 | af, socktype, proto, canonname, sa = res |
729 | 731 | addrlist.append((_intenum_converter(af, AddressFamily), |
730 | | - _intenum_converter(socktype, SocketType), |
| 732 | + _intenum_converter(socktype, SocketKind), |
731 | 733 | proto, canonname, sa)) |
732 | 734 | return addrlist |
0 commit comments