mirror of
https://github.com/python/cpython.git
synced 2025-10-14 02:43:49 +00:00
Issue #28471: Fix crash (GIL state related) in socket.setblocking
This commit is contained in:
parent
33bb64fb30
commit
fa22b29960
3 changed files with 31 additions and 9 deletions
|
@ -4552,6 +4552,18 @@ class TestExceptions(unittest.TestCase):
|
|||
self.assertTrue(issubclass(socket.gaierror, OSError))
|
||||
self.assertTrue(issubclass(socket.timeout, OSError))
|
||||
|
||||
def test_setblocking_invalidfd(self):
|
||||
# Regression test for issue #28471
|
||||
|
||||
sock0 = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
|
||||
sock = socket.socket(
|
||||
socket.AF_INET, socket.SOCK_STREAM, 0, sock0.fileno())
|
||||
sock0.close()
|
||||
|
||||
with self.assertRaises(OSError):
|
||||
sock.setblocking(False)
|
||||
|
||||
|
||||
@unittest.skipUnless(sys.platform == 'linux', 'Linux specific test')
|
||||
class TestLinuxAbstractNamespace(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue