Fix util.popen2 for Python 2.3
authorThomas Arendsen Hein <thomas@intevation.de>
Sun, 19 Oct 2008 12:13:25 +0200
changeset 7163 1be530a3180e
parent 7162 ce10a2f22258
child 7164 cae820101762
child 7166 fb3df69aa785
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
mercurial/util.py
--- 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