##// END OF EJS Templates
util: add 'mode' argument to popen()
Patrick Mezard -
r7221:b340cb53 default
parent child Browse files
Show More
@@ -1044,12 +1044,12 b" if os.name == 'nt':"
1044 # through the current COMSPEC. cmd.exe suppress enclosing quotes.
1044 # through the current COMSPEC. cmd.exe suppress enclosing quotes.
1045 return '"' + cmd + '"'
1045 return '"' + cmd + '"'
1046
1046
1047 def popen(command):
1047 def popen(command, mode='r'):
1048 # Work around "popen spawned process may not write to stdout
1048 # Work around "popen spawned process may not write to stdout
1049 # under windows"
1049 # under windows"
1050 # http://bugs.python.org/issue1366
1050 # http://bugs.python.org/issue1366
1051 command += " 2> %s" % nulldev
1051 command += " 2> %s" % nulldev
1052 return os.popen(quotecommand(command))
1052 return os.popen(quotecommand(command), mode)
1053
1053
1054 def explain_exit(code):
1054 def explain_exit(code):
1055 return _("exited with status %d") % code, code
1055 return _("exited with status %d") % code, code
@@ -1212,8 +1212,8 b' else:'
1212 def quotecommand(cmd):
1212 def quotecommand(cmd):
1213 return cmd
1213 return cmd
1214
1214
1215 def popen(command):
1215 def popen(command, mode='r'):
1216 return os.popen(command)
1216 return os.popen(command, mode)
1217
1217
1218 def testpid(pid):
1218 def testpid(pid):
1219 '''return False if pid dead, True if running or not sure'''
1219 '''return False if pid dead, True if running or not sure'''
General Comments 0
You need to be logged in to leave comments. Login now