comparison hglib/__init__.py @ 72:15485fa4b35e

util: introduce popen
author Idan Kamara <idankk86@gmail.com>
date Mon, 26 Sep 2011 22:37:44 +0300
parents d1f57f162274
children 07efbd3bd09a
comparison
equal deleted inserted replaced
71:20ffb6486412 72:15485fa4b35e
12 encoding=None, configs=None): 12 encoding=None, configs=None):
13 args = util.cmdbuilder('init', dest, e=ssh, remotecmd=remotecmd, 13 args = util.cmdbuilder('init', dest, e=ssh, remotecmd=remotecmd,
14 insecure=insecure) 14 insecure=insecure)
15 15
16 args.insert(0, HGPATH) 16 args.insert(0, HGPATH)
17 proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE, 17 proc = util.popen(args)
18 close_fds=util.closefds)
19
20 out, err = proc.communicate() 18 out, err = proc.communicate()
21 if proc.returncode: 19 if proc.returncode:
22 raise error.CommandError(args, proc.returncode, out, err) 20 raise error.CommandError(args, proc.returncode, out, err)
23 21
24 return open(dest, encoding, configs) 22 return open(dest, encoding, configs)