comparison en/examples/run-example @ 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.
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 07 Aug 2006 15:45:08 -0700
parents a2f0b010d6e3
children 365b41b6a15e
comparison
equal deleted inserted replaced
67:a2f0b010d6e3 68:c574ce277a2b
83 print >> rcfp, 'export TZ=GMT' 83 print >> rcfp, 'export TZ=GMT'
84 print >> rcfp, 'export HGRC="%s/.hgrc"' % tmpdir 84 print >> rcfp, 'export HGRC="%s/.hgrc"' % tmpdir
85 print >> rcfp, 'export HGRCPATH=$HGRC' 85 print >> rcfp, 'export HGRCPATH=$HGRC'
86 print >> rcfp, 'cd %s' % tmpdir 86 print >> rcfp, 'cd %s' % tmpdir
87 rcfp.close() 87 rcfp.close()
88 sys.stdout.flush()
89 sys.stderr.flush()
88 pid, fd = pty.fork() 90 pid, fd = pty.fork()
89 if pid == 0: 91 if pid == 0:
90 #os.execl(self.shell, self.shell) 92 cmdline = ['/bin/bash', '--noediting', '--noprofile', '--norc']
91 os.system('/bin/bash --noediting --noprofile --norc') 93 try:
92 sys.exit(0) 94 os.execv(cmdline[0], cmdline)
95 except OSError, err:
96 print >> sys.stderr, '%s: %s' % (cmdline[0], err.strerror)
97 sys.stderr.flush()
98 os._exit(0)
93 self.cfp = os.fdopen(fd, 'w+') 99 self.cfp = os.fdopen(fd, 'w+')
94 try: 100 try:
95 # setup env and prompt 101 # setup env and prompt
96 self.sendreceive('source %s\n\n' % rcfile) 102 self.sendreceive('source %s\n\n' % rcfile)
97 for hunk in self.parse(): 103 for hunk in self.parse():