]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-31904: add shell requirement for test_pipes (GH-23489)
authorpxinwr <peixing.xin@windriver.com>
Sat, 28 Nov 2020 22:04:50 +0000 (06:04 +0800)
committerGitHub <noreply@github.com>
Sat, 28 Nov 2020 22:04:50 +0000 (14:04 -0800)
VxWorks has no user space shell provided so it can't support pipes module. Also add shell requirement for running test_pipes.

Doc/library/pipes.rst
Lib/test/support/__init__.py
Lib/test/test_pipes.py
Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst [new file with mode: 0644]

index 0a22da1f555bc285906f54250954f11ebf3af95d..57e27a6acf4b6624137ec7004ac1ab3e5f4b9e36 100644 (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:
 
 
index 4ba749454c18735623305cd64606213b15f017fe..5a45d78be9166310d0ee379f3cb07b8d933b2917 100644 (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
index 7d8cd54ba0e5b3371037a14b05129a831c4c915e..6a13b36d1cb70ec430fe7ac50265fbcc18ad9b51 100644 (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
diff --git a/Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst b/Misc/NEWS.d/next/Tests/2020-11-24-17-26-41.bpo-31904.eug834.rst
new file mode 100644 (file)
index 0000000..3e39428
--- /dev/null
@@ -0,0 +1 @@
+add shell requirement for test_pipes