##// END OF EJS Templates
Fix deprecation warning from os.popen3....
Fernando Perez -
Show More
@@ -395,7 +395,8 b" def getoutput(cmd,verbose=0,debug=0,header='',split=0):"
395 395
396 396 if verbose or debug: print header+cmd
397 397 if not debug:
398 output = os.popen(cmd).read()
398 pipe = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout
399 output = pipe.read()
399 400 # stipping last \n is here for backwards compat.
400 401 if output.endswith('\n'):
401 402 output = output[:-1]
@@ -422,7 +423,13 b" def getoutputerror(cmd,verbose=0,debug=0,header='',split=0):"
422 423 else:
423 424 return '',''
424 425 if not debug:
425 pin,pout,perr = os.popen3(cmd)
426 p = subprocess.Popen(cmd, shell=True,
427 stdin=subprocess.PIPE,
428 stdout=subprocess.PIPE,
429 stderr=subprocess.PIPE,
430 close_fds=True)
431 pin, pout, perr = (p.stdin, p.stdout, p.stderr)
432
426 433 tout = pout.read().rstrip()
427 434 terr = perr.read().rstrip()
428 435 pin.close()
General Comments 0
You need to be logged in to leave comments. Login now