@@ -93,6 +93,11 @@ def create_file(filename, content=b'content'):
9393 fp .write (content )
9494
9595
96+ # bpo-41625: On AIX, splice() only works with a socket, not with a pipe.
97+ requires_splice_pipe = unittest .skipIf (sys .platform .startswith ("aix" ),
98+ 'on AIX, splice() only accepts sockets' )
99+
100+
96101class MiscTests (unittest .TestCase ):
97102 def test_getcwd (self ):
98103 cwd = os .getcwd ()
@@ -387,6 +392,7 @@ def test_splice_invalid_values(self):
387392 os .splice (0 , 1 , - 10 )
388393
389394 @unittest .skipUnless (hasattr (os , 'splice' ), 'test needs os.splice()' )
395+ @requires_splice_pipe
390396 def test_splice (self ):
391397 TESTFN2 = os_helper .TESTFN + ".3"
392398 data = b'0123456789'
@@ -419,6 +425,7 @@ def test_splice(self):
419425 self .assertEqual (os .read (read_fd , 100 ), data [:i ])
420426
421427 @unittest .skipUnless (hasattr (os , 'splice' ), 'test needs os.splice()' )
428+ @requires_splice_pipe
422429 def test_splice_offset_in (self ):
423430 TESTFN4 = os_helper .TESTFN + ".4"
424431 data = b'0123456789'
@@ -456,6 +463,7 @@ def test_splice_offset_in(self):
456463 self .assertEqual (read , data [in_skip :in_skip + i ])
457464
458465 @unittest .skipUnless (hasattr (os , 'splice' ), 'test needs os.splice()' )
466+ @requires_splice_pipe
459467 def test_splice_offset_out (self ):
460468 TESTFN4 = os_helper .TESTFN + ".4"
461469 data = b'0123456789'
0 commit comments