Tweak something or other for sake of python 3
This commit is contained in:
parent
7dcc8f8efb
commit
85d51948dc
|
@ -18,7 +18,7 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA.
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
import os, os.path, re, time, sys, traceback, unicodedata, shutil, mimetypes
|
||||
import os, os.path, re, time, sys, traceback, unicodedata, shutil, mimetypes, subprocess
|
||||
sequenceTypes = (list, tuple)
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
@ -246,7 +246,12 @@ def getTempFileName(prefix='', extension=''):
|
|||
# ------------------------------------------------------------------------------
|
||||
def executeCommand(cmd):
|
||||
'''Executes command p_cmd and returns the content of its stderr'''
|
||||
childStdIn, childStdOut, childStdErr = os.popen3(cmd)
|
||||
p = subprocess.Popen(cmd, shell=True,
|
||||
stdin=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
close_fds=True)
|
||||
childStdIn, childStdOut, childStdErr = (p.stdin, p.stdout, p.stderr)
|
||||
res = childStdErr.read()
|
||||
childStdIn.close(); childStdOut.close(); childStdErr.close()
|
||||
return res
|
||||
|
|
Loading…
Reference in a new issue