Fixes setup compatibility issue on Windows

Fixes Bug #1052161

"python setup.py build" fails on Windows due to a hardcoded shell path:
/bin/sh

Change-Id: I9b5838aa96d3f41f8baf58f28d3e9e6d9646f6cb
This commit is contained in:
Joe Heck
2012-09-25 15:47:51 +00:00
parent 57d48aad91
commit 818ab8e3cd

View File

@@ -116,8 +116,12 @@ def write_requirements():
def _run_shell_command(cmd):
output = subprocess.Popen(["/bin/sh", "-c", cmd],
stdout=subprocess.PIPE)
if os.name == 'nt':
output = subprocess.Popen(["cmd.exe", "/C", cmd],
stdout=subprocess.PIPE)
else:
output = subprocess.Popen(["/bin/sh", "-c", cmd],
stdout=subprocess.PIPE)
out = output.communicate()
if len(out) == 0:
return None