Skip to content

Commit

Permalink
Merge pull request #770 from bfloch/feature/fix_popen_in_cmd
Browse files Browse the repository at this point in the history
Fixes cmd due to oversight in 9c8334a
  • Loading branch information
nerdvegas authored Oct 24, 2019
2 parents 87c3a67 + af92004 commit 35470a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/rez/tests/test_shells.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,8 @@ def _execute_code(func, expected_output):
out, _ = p.communicate()
self.assertEqual(p.returncode, 0)

# PowerShell and Unix uses \n, cmd etc use \r\n
sh = create_shell()
output = out.strip().split(sh.line_terminator())
output = out.strip().split("\n")

self.assertEqual(output, expected_output)

Expand Down
4 changes: 2 additions & 2 deletions src/rezplugins/shell/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def gen_expected_regex(parts):
"(.*)"
])

p = popen(cmd, stdout=subprocess.PIPE,
p = Popen(cmd, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, shell=True, text=True)
out_, _ = p.communicate()
out_ = out_.strip()
Expand Down Expand Up @@ -243,7 +243,7 @@ def _create_ex():
cmd += ['call {}'.format(target_file)]
is_detached = (cmd[0] == 'START')

p = popen(cmd, env=env, shell=is_detached, **Popen_args)
p = Popen(cmd, env=env, shell=is_detached, **Popen_args)
return p

def get_output(self, style=OutputStyle.file):
Expand Down

0 comments on commit 35470a9

Please sign in to comment.