Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit ca07f6e9e260a6fb121a17e92cb28acc5b09b482 1 parent 403714d
Justine Tunney authored
Showing with 2 additions and 6 deletions.
  1. +2 −6 bin/casperjs
View
8 bin/casperjs
@@ -48,11 +48,7 @@ CASPER_COMMAND.extend([os.path.join(CASPER_PATH, 'bin', 'bootstrap.js'), '--casp
CASPER_COMMAND.extend(CASPER_ARGS)
try:
- status = subprocess.call(CASPER_COMMAND)
+ os.execvp(CASPER_COMMAND[0], CASPER_COMMAND)
except OSError, err:
- status = 1
print('Fatal: %s; did you install phantomjs?' % err)
-except KeyboardInterrupt:
- print('\nCasperJS interrupted, exiting.')
- status = 0
-sys.exit(status)
+ sys.exit(1)
Please sign in to comment.
Something went wrong with that request. Please try again.