summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_fcntl.py
diff options
context:
space:
mode:
authorHyunkyun Moon <hyunkyun.moon@linecorp.com>2023-03-01 14:56:19 (GMT)
committerGitHub <noreply@github.com>2023-03-01 14:56:19 (GMT)
commit2f62a5da949cd368a9498e6a03e700f4629fa97f (patch)
tree50b136092f68e0a97b7280c79bad168f8af77f08 /Lib/test/test_fcntl.py
parentc1748ed59dc30ab99fe69c22bdbab54f93baa57c (diff)
downloadcpython-2f62a5da949cd368a9498e6a03e700f4629fa97f.zip
cpython-2f62a5da949cd368a9498e6a03e700f4629fa97f.tar.gz
cpython-2f62a5da949cd368a9498e6a03e700f4629fa97f.tar.bz2
gh-95672 skip fcntl when pipesize is smaller than pagesize (gh-102163)
Diffstat (limited to 'Lib/test/test_fcntl.py')
-rw-r--r--Lib/test/test_fcntl.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_fcntl.py b/Lib/test/test_fcntl.py
index 26de67d..5da7561 100644
--- a/Lib/test/test_fcntl.py
+++ b/Lib/test/test_fcntl.py
@@ -6,7 +6,7 @@ import os
import struct
import sys
import unittest
-from test.support import verbose, cpython_only
+from test.support import verbose, cpython_only, get_pagesize
from test.support.import_helper import import_module
from test.support.os_helper import TESTFN, unlink
@@ -201,7 +201,8 @@ class TestFcntl(unittest.TestCase):
# Get the default pipesize with F_GETPIPE_SZ
pipesize_default = fcntl.fcntl(test_pipe_w, fcntl.F_GETPIPE_SZ)
pipesize = pipesize_default // 2 # A new value to detect change.
- if pipesize < 512: # the POSIX minimum
+ pagesize_default = get_pagesize()
+ if pipesize < pagesize_default: # the POSIX minimum
raise unittest.SkipTest(
'default pipesize too small to perform test.')
fcntl.fcntl(test_pipe_w, fcntl.F_SETPIPE_SZ, pipesize)