@@ -828,7 +828,6 @@ internal_setblocking(PySocketSockObject *s, int block)
828828 int delay_flag , new_delay_flag ;
829829#endif
830830
831- Py_BEGIN_ALLOW_THREADS
832831#ifndef MS_WINDOWS
833832#if (defined(HAVE_SYS_IOCTL_H ) && defined(FIONBIO ))
834833 block = !block ;
@@ -855,8 +854,6 @@ internal_setblocking(PySocketSockObject *s, int block)
855854 result = 0 ;
856855
857856 done :
858- Py_END_ALLOW_THREADS
859-
860857 if (result ) {
861858#ifndef MS_WINDOWS
862859 PyErr_SetFromErrno (PyExc_OSError );
@@ -3915,9 +3912,7 @@ _socket_socket_getsockname_impl(PySocketSockObject *s)
39153912 if (!getsockaddrlen (s , & addrlen ))
39163913 return NULL ;
39173914 memset (& addrbuf , 0 , addrlen );
3918- Py_BEGIN_ALLOW_THREADS
39193915 res = getsockname (get_sock_fd (s ), SAS2SA (& addrbuf ), & addrlen );
3920- Py_END_ALLOW_THREADS
39213916 if (res < 0 )
39223917 return s -> errorhandler ();
39233918 return makesockaddr (get_sock_fd (s ), SAS2SA (& addrbuf ), addrlen ,
@@ -3950,9 +3945,7 @@ _socket_socket_getpeername_impl(PySocketSockObject *s)
39503945 if (!getsockaddrlen (s , & addrlen ))
39513946 return NULL ;
39523947 memset (& addrbuf , 0 , addrlen );
3953- Py_BEGIN_ALLOW_THREADS
39543948 res = getpeername (get_sock_fd (s ), SAS2SA (& addrbuf ), & addrlen );
3955- Py_END_ALLOW_THREADS
39563949 if (res < 0 )
39573950 return s -> errorhandler ();
39583951 return makesockaddr (get_sock_fd (s ), SAS2SA (& addrbuf ), addrlen ,
@@ -5968,9 +5961,7 @@ _socket_gethostname_impl(PyObject *module)
59685961#else
59695962 char buf [1024 ];
59705963 int res ;
5971- Py_BEGIN_ALLOW_THREADS
59725964 res = gethostname (buf , (int ) sizeof buf - 1 );
5973- Py_END_ALLOW_THREADS
59745965 if (res < 0 )
59755966 return set_error ();
59765967 buf [sizeof buf - 1 ] = '\0' ;
0 commit comments