mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix python 3 path for shell test cases
This commit is contained in:
parent
a2bbf4dea8
commit
7bb4ceb620
1 changed files with 8 additions and 0 deletions
|
@ -246,6 +246,14 @@ class ShellTestCase(TestCase, AdaptedConfigurationTestCaseMixin):
|
|||
|
||||
if salt.utils.is_windows():
|
||||
cmd = 'python '
|
||||
if 'cwd' not in popen_kwargs:
|
||||
popen_kwargs['cwd'] = os.getcwd()
|
||||
if 'env' not in popen_kwargs:
|
||||
popen_kwargs['env'] = os.environ.copy()
|
||||
if sys.version_info[0] < 3:
|
||||
popen_kwargs['env'][b'PYTHONPATH'] = os.getcwd().encode()
|
||||
else:
|
||||
popen_kwargs['env']['PYTHONPATH'] = os.getcwd()
|
||||
else:
|
||||
cmd = 'PYTHONPATH='
|
||||
python_path = os.environ.get('PYTHONPATH', None)
|
||||
|
|
Loading…
Add table
Reference in a new issue