mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Issue #27472: Add test.support.unix_shell as the path to the default shell.
This commit is contained in:
parent
de85ed69f4
commit
d141531eb5
5 changed files with 24 additions and 13 deletions
|
@ -1,7 +1,8 @@
|
|||
"""Tests for distutils.spawn."""
|
||||
import unittest
|
||||
import sys
|
||||
import os
|
||||
from test.support import run_unittest
|
||||
from test.support import run_unittest, unix_shell
|
||||
|
||||
from distutils.spawn import _nt_quote_args
|
||||
from distutils.spawn import spawn
|
||||
|
@ -29,9 +30,9 @@ class SpawnTestCase(support.TempdirManager,
|
|||
|
||||
# creating something executable
|
||||
# through the shell that returns 1
|
||||
if os.name == 'posix':
|
||||
if sys.platform != 'win32':
|
||||
exe = os.path.join(tmpdir, 'foo.sh')
|
||||
self.write_file(exe, '#!/bin/sh\nexit 1')
|
||||
self.write_file(exe, '#!%s\nexit 1' % unix_shell)
|
||||
else:
|
||||
exe = os.path.join(tmpdir, 'foo.bat')
|
||||
self.write_file(exe, 'exit 1')
|
||||
|
@ -40,9 +41,9 @@ class SpawnTestCase(support.TempdirManager,
|
|||
self.assertRaises(DistutilsExecError, spawn, [exe])
|
||||
|
||||
# now something that works
|
||||
if os.name == 'posix':
|
||||
if sys.platform != 'win32':
|
||||
exe = os.path.join(tmpdir, 'foo.sh')
|
||||
self.write_file(exe, '#!/bin/sh\nexit 0')
|
||||
self.write_file(exe, '#!%s\nexit 0' % unix_shell)
|
||||
else:
|
||||
exe = os.path.join(tmpdir, 'foo.bat')
|
||||
self.write_file(exe, 'exit 0')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue