Fix util.popen2 for Python 2.3
1. trigger ImportError early, so fallbacks are activated
2. util.popen2 replaces previous usage of os.popen2, not popen2.popen2
--- a/mercurial/util.py Sat Oct 18 21:52:22 2008 -0700
+++ b/mercurial/util.py Sun Oct 19 12:13:25 2008 +0200
@@ -51,6 +51,7 @@
try:
import subprocess
+ subprocess.Popen # trigger ImportError early
closefds = os.name == 'posix'
def popen2(cmd, mode='t', bufsize=-1):
p = subprocess.Popen(cmd, shell=True, bufsize=bufsize,
@@ -76,7 +77,7 @@
except ImportError:
subprocess = None
import popen2 as _popen2
- popen2 = _popen2.popen2
+ popen2 = os.popen2
Popen3 = _popen2.Popen3