From 818ab8e3cd024826ac0d0686ff7fa8243db7d4e8 Mon Sep 17 00:00:00 2001 From: Joe Heck Date: Tue, 25 Sep 2012 15:47:51 +0000 Subject: [PATCH] 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 --- keystoneclient/openstack/common/setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/keystoneclient/openstack/common/setup.py b/keystoneclient/openstack/common/setup.py index caf06fa5b..e434968ba 100644 --- a/keystoneclient/openstack/common/setup.py +++ b/keystoneclient/openstack/common/setup.py @@ -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