command_output: insure py2/3 compat
This should make pass
@@ -797,11 +797,16 @@ def command_output(cmd, shell=False):
"""
cmd = convert_command_args(cmd)
+ try: # python >= 3.3
+ devnull = subprocess.DEVNULL
+ except AttributeError:
+ devnull = open(os.devnull, 'r+b')
+
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
- stdin=subprocess.DEVNULL,
+ stdin=devnull,
close_fds=platform.system() != 'Windows',
shell=shell
)
