toolsutils.py
changeset 4587 70d47389630c
parent 4556 43c14e0e8972
child 4721 8f63691ccb7f
--- a/toolsutils.py	Thu Feb 11 12:19:08 2010 +0100
+++ b/toolsutils.py	Mon Feb 15 18:44:47 2010 +0100
@@ -10,6 +10,7 @@
 # XXX move most of this in logilab.common (shellutils ?)
 
 import os, sys
+import subprocess
 from os import listdir, makedirs, environ, chmod, walk, remove
 from os.path import exists, join, abspath, normpath
 
@@ -75,8 +76,8 @@
     user decision
     """
     import shutil
-    p_output = os.popen('diff -u %s %s' % (appl_file, ref_file), 'r')
-    diffs = p_output.read()
+    pipe = subprocess.Popen(['diff', '-u', appl_file, ref_file], stdout=subprocess.PIPE)
+    diffs = pipe.stdout.read()
     if diffs:
         if askconfirm:
             print