Commit 3f2a26b7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

py2/py3: stop using popen2.

parent 110f87ee
...@@ -38,7 +38,7 @@ import os ...@@ -38,7 +38,7 @@ import os
import sys import sys
import tempfile import tempfile
import zipfile import zipfile
import popen2 import subprocess
from six.moves import urllib from six.moves import urllib
from six.moves import cStringIO as StringIO from six.moves import cStringIO as StringIO
...@@ -93,8 +93,12 @@ elif odfpy: ...@@ -93,8 +93,12 @@ elif odfpy:
fd, file_name = tempfile.mkstemp() fd, file_name = tempfile.mkstemp()
os.write(fd, odf_file_content) os.write(fd, odf_file_content)
os.close(fd) os.close(fd)
stdout, stdin = popen2.popen4('odflint %s' % file_name) process = subprocess.Popen(
stdin.close() ['odflint', file_name],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
stdout, _ = process.communicate()
error_list = '' error_list = ''
for line in stdout: for line in stdout:
if line.startswith('Error: '): if line.startswith('Error: '):
......
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