diff 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
line wrap: on
line diff
--- a/en/examples/run-example	Mon Aug 07 15:35:14 2006 -0700
+++ b/en/examples/run-example	Mon Aug 07 15:45:08 2006 -0700
@@ -85,11 +85,17 @@
         print >> rcfp, 'export HGRCPATH=$HGRC'
         print >> rcfp, 'cd %s' % tmpdir
         rcfp.close()
+        sys.stdout.flush()
+        sys.stderr.flush()
         pid, fd = pty.fork()
         if pid == 0:
-            #os.execl(self.shell, self.shell)
-            os.system('/bin/bash --noediting --noprofile --norc')
-            sys.exit(0)
+            cmdline = ['/bin/bash', '--noediting', '--noprofile', '--norc']
+            try:
+                os.execv(cmdline[0], cmdline)
+            except OSError, err:
+                print >> sys.stderr, '%s: %s' % (cmdline[0], err.strerror)
+                sys.stderr.flush()
+                os._exit(0)
         self.cfp = os.fdopen(fd, 'w+')
         try:
             # setup env and prompt