Skip to content

Commit 6ea686a

Browse files
committed
Fix CPython issue #19293 (hangs on AIX).
1 parent 74a367d commit 6ea686a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

tests/test_events.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -887,9 +887,6 @@ def connect():
887887

888888
@unittest.skipUnless(sys.platform != 'win32',
889889
"Don't support pipes for Windows")
890-
# Issue #19293
891-
@unittest.skipIf(sys.platform.startswith("aix"),
892-
'cannot be interrupted with signal on AIX')
893890
def test_write_pipe_disconnect_on_close(self):
894891
proto = None
895892
transport = None
@@ -899,8 +896,8 @@ def factory():
899896
proto = MyWritePipeProto(loop=self.loop)
900897
return proto
901898

902-
rpipe, wpipe = os.pipe()
903-
pipeobj = io.open(wpipe, 'wb', 1024)
899+
rsock, wsock = self.loop._socketpair()
900+
pipeobj = io.open(wsock.detach(), 'wb', 1024)
904901

905902
@tasks.coroutine
906903
def connect():
@@ -916,11 +913,10 @@ def connect():
916913
self.assertEqual('CONNECTED', proto.state)
917914

918915
transport.write(b'1')
919-
test_utils.run_briefly(self.loop)
920-
data = os.read(rpipe, 1024)
916+
data = self.loop.run_until_complete(self.loop.sock_recv(rsock, 1024))
921917
self.assertEqual(b'1', data)
922918

923-
os.close(rpipe)
919+
rsock.close()
924920

925921
self.loop.run_until_complete(proto.done)
926922
self.assertEqual('CLOSED', proto.state)

0 commit comments

Comments
 (0)