@@ -832,7 +832,6 @@ internal_setblocking(PySocketSockObject *s, int block)
832832 int delay_flag , new_delay_flag ;
833833#endif
834834
835- Py_BEGIN_ALLOW_THREADS
836835#ifndef MS_WINDOWS
837836#if (defined(HAVE_SYS_IOCTL_H ) && defined(FIONBIO ))
838837 block = !block ;
@@ -859,8 +858,6 @@ internal_setblocking(PySocketSockObject *s, int block)
859858 result = 0 ;
860859
861860 done :
862- Py_END_ALLOW_THREADS
863-
864861 if (result ) {
865862#ifndef MS_WINDOWS
866863 PyErr_SetFromErrno (PyExc_OSError );
@@ -3917,9 +3914,7 @@ _socket_socket_getsockname_impl(PySocketSockObject *s)
39173914 if (!getsockaddrlen (s , & addrlen ))
39183915 return NULL ;
39193916 memset (& addrbuf , 0 , addrlen );
3920- Py_BEGIN_ALLOW_THREADS
39213917 res = getsockname (get_sock_fd (s ), SAS2SA (& addrbuf ), & addrlen );
3922- Py_END_ALLOW_THREADS
39233918 if (res < 0 )
39243919 return s -> errorhandler ();
39253920 return makesockaddr (get_sock_fd (s ), SAS2SA (& addrbuf ), addrlen ,
@@ -3952,9 +3947,7 @@ _socket_socket_getpeername_impl(PySocketSockObject *s)
39523947 if (!getsockaddrlen (s , & addrlen ))
39533948 return NULL ;
39543949 memset (& addrbuf , 0 , addrlen );
3955- Py_BEGIN_ALLOW_THREADS
39563950 res = getpeername (get_sock_fd (s ), SAS2SA (& addrbuf ), & addrlen );
3957- Py_END_ALLOW_THREADS
39583951 if (res < 0 )
39593952 return s -> errorhandler ();
39603953 return makesockaddr (get_sock_fd (s ), SAS2SA (& addrbuf ), addrlen ,
@@ -5970,9 +5963,7 @@ _socket_gethostname_impl(PyObject *module)
59705963#else
59715964 char buf [1024 ];
59725965 int res ;
5973- Py_BEGIN_ALLOW_THREADS
59745966 res = gethostname (buf , (int ) sizeof buf - 1 );
5975- Py_END_ALLOW_THREADS
59765967 if (res < 0 )
59775968 return set_error ();
59785969 buf [sizeof buf - 1 ] = '\0' ;
0 commit comments