hgbook
changeset 68:c574ce277a2b
Mostly random attempt to see if fiddling with the child will help the parent.
Motivated by problems people are having on Debian sid and FreeBSD.
Motivated by problems people are having on Debian sid and FreeBSD.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Aug 07 15:45:08 2006 -0700 (2006-08-07) |
parents | a2f0b010d6e3 |
children | e9dd634ab99e |
files | en/examples/run-example |
line diff
1.1 --- a/en/examples/run-example Mon Aug 07 15:35:14 2006 -0700 1.2 +++ b/en/examples/run-example Mon Aug 07 15:45:08 2006 -0700 1.3 @@ -85,11 +85,17 @@ 1.4 print >> rcfp, 'export HGRCPATH=$HGRC' 1.5 print >> rcfp, 'cd %s' % tmpdir 1.6 rcfp.close() 1.7 + sys.stdout.flush() 1.8 + sys.stderr.flush() 1.9 pid, fd = pty.fork() 1.10 if pid == 0: 1.11 - #os.execl(self.shell, self.shell) 1.12 - os.system('/bin/bash --noediting --noprofile --norc') 1.13 - sys.exit(0) 1.14 + cmdline = ['/bin/bash', '--noediting', '--noprofile', '--norc'] 1.15 + try: 1.16 + os.execv(cmdline[0], cmdline) 1.17 + except OSError, err: 1.18 + print >> sys.stderr, '%s: %s' % (cmdline[0], err.strerror) 1.19 + sys.stderr.flush() 1.20 + os._exit(0) 1.21 self.cfp = os.fdopen(fd, 'w+') 1.22 try: 1.23 # setup env and prompt