Source

pypy / dotviewer / graphparse.py

Diff from to

File dotviewer/graphparse.py

 Graph file parsing.
 """
 
-import os, sys, re
+import sys, re
+import subprocess
+
 import msgstruct
 
 re_nonword = re.compile(r'([^0-9a-zA-Z_.]+)')
         else:
             cmdline = 'neato -Tplain'
         #print >> sys.stderr, '* running:', cmdline
-        child_in, child_out = os.popen2(cmdline, 'r')
+        close_fds = sys.platform != 'win32'
+        p = subprocess.Popen(cmdline, shell=True, close_fds=close_fds,
+                             stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+        (child_in, child_out) = (p.stdin, p.stdout)
         try:
             import thread
         except ImportError: