changeset 7163:1be530a3180e

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
author Thomas Arendsen Hein <thomas@intevation.de>
date Sun, 19 Oct 2008 12:13:25 +0200
parents ce10a2f22258
children cae820101762 fb3df69aa785
files mercurial/util.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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