125 from distutils.core import Distribution |
125 from distutils.core import Distribution |
126 except ImportError: |
126 except ImportError: |
127 py2exeloaded = False |
127 py2exeloaded = False |
128 |
128 |
129 def runcmd(cmd, env): |
129 def runcmd(cmd, env): |
130 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
130 if sys.platform == 'plan9': |
131 stderr=subprocess.PIPE, env=env) |
131 # subprocess kludge to work around issues in half-baked Python |
132 out, err = p.communicate() |
132 # ports, notably bichued/python: |
133 return out, err |
133 _, out, err = os.popen3(cmd) |
|
134 return str(out), str(err) |
|
135 else: |
|
136 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
|
137 stderr=subprocess.PIPE, env=env) |
|
138 out, err = p.communicate() |
|
139 return out, err |
134 |
140 |
135 def runhg(cmd, env): |
141 def runhg(cmd, env): |
136 out, err = runcmd(cmd, env) |
142 out, err = runcmd(cmd, env) |
137 # If root is executing setup.py, but the repository is owned by |
143 # If root is executing setup.py, but the repository is owned by |
138 # another user (as in "sudo python setup.py install") we will get |
144 # another user (as in "sudo python setup.py install") we will get |