Skip to content

Commit 44c5ed9

Browse files
committed
Restore getattr in socket.py
1 parent 4752f84 commit 44c5ed9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Lib/socket.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@
6767
"has_dualstack_ipv6", "AddressFamily", "SocketKind"]
6868
__all__.extend(os._get_exports_list(_socket))
6969

70+
def __getattr__(name):
71+
if name == "SocketType":
72+
return _socket.socket
73+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
74+
7075

7176
# Set up the socket.AF_* socket.SOCK_* constants as members of IntEnums for
7277
# nicer string representations.

0 commit comments

Comments
 (0)