SVN: zdaemon/branches/matt-python-versions/src/zdaemon/tests/tests.py Changed os.popen4 to the 'subprocess' module to make Python 2.6 happy.

"[email protected]" <[email protected]>
Newsgroups gmane.comp.web.zope.zope3.cvs
Message-ID <[email protected]>
Log message for revision 93354:
  Changed os.popen4 to the 'subprocess' module to make Python 2.6 happy.
  

Changed:
  U   zdaemon/branches/matt-python-versions/src/zdaemon/tests/tests.py

-=-
Modified: zdaemon/branches/matt-python-versions/src/zdaemon/tests/tests.py
===================================================================
--- zdaemon/branches/matt-python-versions/src/zdaemon/tests/tests.py	2008-11-25 22:18:20 UTC (rev 93353)
+++ zdaemon/branches/matt-python-versions/src/zdaemon/tests/tests.py	2008-11-25 22:24:15 UTC (rev 93354)
@@ -12,7 +12,7 @@
 #
 ##############################################################################
 
-import os, re, shutil, sys, tempfile, unittest
+import os, re, shutil, sys, tempfile, unittest, subprocess
 import ZConfig, zdaemon
 from zope.testing import doctest, renormalizing
 
@@ -112,7 +112,10 @@
         f()
 
 def system(command, input=''):
-    i, o = os.popen4(command)
+    PIPE = subprocess.PIPE
+    p = subprocess.Popen(command, shell=True, bufsize=0,
+              stdin=PIPE, stdout=PIPE, close_fds=True)
+    (i, o) = (p.stdin, p.stdout)
     if input:
         i.write(input)
     i.close()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.