Skip to content

Commit 9c66f63

Browse files
committed
gh-148783: Respect explicit socket proto
1 parent 8276778 commit 9c66f63

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/socketmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5746,8 +5746,8 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
57465746
#else
57475747
type = SOCK_STREAM;
57485748
#endif
5749-
#ifdef SO_PROTOCOL
57505749
if (proto == -1) {
5750+
#ifdef SO_PROTOCOL
57515751
int tmp;
57525752
socklen_t slen = sizeof(tmp);
57535753
if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL,
@@ -5758,10 +5758,10 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
57585758
set_error();
57595759
return -1;
57605760
}
5761-
}
57625761
#else
57635762
proto = 0;
57645763
#endif
5764+
}
57655765
}
57665766
}
57675767
else {

0 commit comments

Comments
 (0)