Commit c9a8d084 authored by Julien Cristau's avatar Julien Cristau
Browse files

Use subprocess instead of os.popen4 to fix deprecation warning. Closes #89394

parent 5a232029d333
......@@ -17,6 +17,7 @@
# with logilab-mtconverter. If not, see <>.
import os
from tempfile import mkstemp
import subprocess
from logilab.mtconverter import MissingBinary
from logilab.mtconverter.transform import Transform
......@@ -77,7 +78,9 @@ class POpenTransform(Transform):
os.write(tmpfile, data) # write data to tmp using a file descriptor
os.close(tmpfile) # close it so the other process can read it
command = command % {'infile' : tmpname} # apply tmp name to command
cin, couterr = os.popen4(command, 'b')
cin, couterr = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE,
stderr=subprocess.STDOUT, close_fds=True)
if self.use_stdin:
status = cin.close()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment