Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bpo-31904: skip some test case in test_cmd_line for VxWorks doesn't
support preexec

subprocess.Popen doesn't support preexec, test_cmd_line need to skip the
case which use preexec
  • Loading branch information
LihuaZhao committed Apr 1, 2019
commit e64be8ccde9e140cfdfff5a976e5872b965e5afc
6 changes: 6 additions & 0 deletions Lib/test/test_cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
# Debug build?
Py_DEBUG = hasattr(sys, "gettotalrefcount")

def _supports_preexec():
if sys.platform == "vxworks":
return False
else:
return True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest:

SUBPROCESS_SUPPORTS_PREEXEC = (sys.platform != "vxworks")


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum, please revert this unrelated change.

# XXX (ncoghlan): Move to script_helper and make consistent with run_python
def _kill_python_and_exit_code(p):
Expand Down Expand Up @@ -369,6 +374,7 @@ def test_closed_stdout(self):
# Issue #7111: Python should work without standard streams

@unittest.skipIf(os.name != 'posix', "test needs POSIX semantics")
@unittest.skipUnless(_supports_preexec(), "test needs preexec support in subprocess.Popen")
def _test_no_stdio(self, streams):
code = """if 1:
import os, sys
Expand Down