Skip to content
Browse files

make python launcher use os.execvp() instead of subprocess.Popen()

This fixes a bug where casperjs' python launcher process won't pass along kill
signals to the phantomjs subprocess. This patch works by using an exec system
call which causes the phantomjs subprocess to completely replace the casperjs
parent process (while maintaining the same pid). This patch also has the added
benefit of saving 10 megs or so of memory.
  • Loading branch information...
1 parent 403714d commit ca07f6e9e260a6fb121a17e92cb28acc5b09b482 Justine Tunney committed
Showing with 2 additions and 6 deletions.
  1. +2 −6 bin/casperjs
8 bin/casperjs
@@ -48,11 +48,7 @@ CASPER_COMMAND.extend([os.path.join(CASPER_PATH, 'bin', 'bootstrap.js'), '--casp
- status =
except OSError, err:
- status = 1
print('Fatal: %s; did you install phantomjs?' % err)
-except KeyboardInterrupt:
- print('\nCasperJS interrupted, exiting.')
- status = 0
+ sys.exit(1)

0 comments on commit ca07f6e

Please sign in to comment.
Something went wrong with that request. Please try again.