bpo-31904: add shell requirement for test_pipes (GH-23489)

VxWorks has no user space shell provided so it can't support pipes module. Also add shell requirement for running test_pipes.
This commit is contained in:
pxinwr 2020-11-29 06:04:50 +08:00 committed by GitHub
parent 996a1ef8ae
commit a86a274b72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -17,6 +17,8 @@ The :mod:`pipes` module defines a class to abstract the concept of a *pipeline*
Because the module uses :program:`/bin/sh` command lines, a POSIX or compatible
shell for :func:`os.system` and :func:`os.popen` is required.
.. availability:: Unix. Not available on VxWorks.
The :mod:`pipes` module defines the following class:

View File

@ -421,7 +421,7 @@ is_jython = sys.platform.startswith('java')
is_android = hasattr(sys, 'getandroidapilevel')
if sys.platform != 'win32':
if sys.platform not in ('win32', 'vxworks'):
unix_shell = '/system/bin/sh' if is_android else '/bin/sh'
else:
unix_shell = None

View File

@ -3,13 +3,16 @@ import os
import string
import unittest
import shutil
from test.support import run_unittest, reap_children
from test.support import run_unittest, reap_children, unix_shell
from test.support.os_helper import TESTFN, unlink
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
if not (unix_shell and os.path.exists(unix_shell)):
raise unittest.SkipTest('pipes module requires a shell')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit

View File

@ -0,0 +1 @@
add shell requirement for test_pipes